rails 3 教程:没有路由匹配 [GET] "/"; [英] rails 3 tutorial: No route matches [GET] "/"

查看:44
本文介绍了rails 3 教程:没有路由匹配 [GET] "/";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,

几个小时前为 PDF 付费,仔细按照说明操作,但在启动 first_app 后,我在 localhost:3000 中看到:

Paid for the PDF a few hours ago, followed the instructions carefully but after starting up first_app I see this in localhost:3000:

Routing Error

No route matches [GET] "/"

没有接触任何代码,只是在执行rails new first_app"后启动了服务器.

Haven't touched any code, just started up the server after doing "rails new first_app".

从命令行:

552 ~/Downloads/rails_projects/first_app>=> Booting WEBrick
=> Rails 3.1.0.rc6 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Sprockets::Environment#static_root is deprecated
[2011-08-20 16:44:40] INFO  WEBrick 1.3.1
[2011-08-20 16:44:40] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
[2011-08-20 16:44:40] INFO  WEBrick::HTTPServer#start: pid=97719 port=3000

552 ~/Downloads/rails_projects/first_app>cache: [GET /] miss

Started GET "/" for 127.0.0.1 at 2011-08-20 16:45:06 -0400

ActionController::RoutingError (No route matches [GET] "/"):

Rendered /Users/briano/.rvm/gems/ruby-1.9.2-p290@rails3.1/gems/actionpack-3.1.0.rc6
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within 
rescues/layout (7.3ms)

使用 rails 3.1 和 ruby​​ 1.9.2:

Using rails 3.1 and ruby 1.9.2:

554 ~/Downloads/rails_projects/first_app>rails -v
Rails 3.1.0.rc6
555 ~/Downloads/rails_projects/first_app>ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

使用rvm,创建了一个特殊的gemset,等等.有什么想法吗?

Using rvm, created a special gemset, and so on. Any thoughts?

推荐答案

服务器正在尝试使用缓存机制(因为它处于生产模式).

The server is trying to use a caching mechanism (since it's in production mode).

尝试在开发中运行它.

这个问题有很多关于如何运行你的应用的答案在生产中(简单地说,用开发替换他们的解决方案).

This question has a bunch of answers for how to run your app in production (simply, replace their solutions with development).

这篇关于rails 3 教程:没有路由匹配 [GET] "/";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆