我最近在 Windows 7 旁边安装了 Ubuntu 14.10,以使 Rails 中的开发更容易。我把所有东西都启动并运行起来,并将我的项目带入了 Ubuntu。当我在项目文件夹中启动 Rails 服务器时,它运行得很好,但是当我转到 localhost:3000 时,我得到了“你的 Ruby on Rails”通用占位符,而不是我设置的根主页,也不能使用我在路由文件中设置的任何地址。如果有人对可以缓解此问题的任何经验或想法,我将不胜感激。我不想回到在 Windows 中进行开发...在此先感谢。
路线:
Rails.application.routes.draw do
root 'static_pages#home'
get 'help' => 'static_pages#help'
get 'about' => 'static_pages#about'
get 'contact' => 'static_pages#contact'
get 'signup' => 'users#new'
resources :users
end
最佳答案
删除文件 public/index.html,它优先于你的路由。
关于ruby-on-rails - Rails 服务器正在运行,但没有将我带到我的项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28516362/