开发者

No routes found

I recently upgrade to Rails 3, and after fixing most of the issues I have my server running. However, I amgetting a rather usual error:

Started GET "/" for 10.0.0.1 at Sat May 14 00:37:26 +0000 2011                                                                                                                                                                         

ActionController::RoutingError (No route matches "/"): 

when I try to visit http://localhost:9292/

for reference I'm running my server via rackup.

If I look in my routes.rb file, I see:

RailsRoot::A开发者_运维问答pplication.routes do 
    # ...
    match '/', :to => "application#show"                                                                                                                                                                                                             
    root :to => 'application#show' 
    # ...
end

For reference application is a controller and it does have an action show, and my application is named RailsRoot.

Given that I believe I've constructed my routes correctly it seems likely that I've installed something wrong or something went wrong in the upgrade, but I'm not sure where seeing as almost everything else is working.

Does anyone know why this might be?


In your routes.rb, change this line

RailsRoot::Application.routes do

to this

RailsRoot::Application.routes.draw do
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜