Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

railstutorial.org - rails 3 tutorial: No route matches [GET] "/"

SO,

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] "/"

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

From the command-line:

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/[email protected]/gems/actionpack-3.1.0.rc6
/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within 
rescues/layout (7.3ms)

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]

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

Try running it in development.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...