嘗試訪問我的頁面時出現路由錯誤。Ruby on Rails路由問題
Routing Error
No route matches "/" with {:method=>:get}
錯誤日誌上寫着:
[4;36;1mSQL (0.1ms)[0m [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.0ms)[0m [0mSET SQL_AUTO_IS_NULL=0[0m
Processing ApplicationController#index (for 68.116.193.166 at 2010-10-11 19:18:16) [GET]
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
config/initializers/mongrel.rb:62:in `dispatch_cgi'
Rendering rescues/layout (not_found)
通常當我看到這個我檢查路由在配置/ routes.rb中定義的,它們是。所以我想通過鍵入它可以訪問/新的,其中給了我下面的錯誤。
Routing Error
No route matches **"//new"** with {:method=>:get}
隨着development.log以下
[4;36;1mSQL (0.1ms)[0m [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.0ms)[0m [0mSET SQL_AUTO_IS_NULL=0[0m
Processing ApplicationController#index (for 68.116.193.166 at 2010-10-11 19:18:21) [GET]
ActionController::RoutingError (No route matches "//new" with {:method=>:get}):
config/initializers/mongrel.rb:62:in `dispatch_cgi'
Rendering rescues/layout (not_found)
我的設置: 的Rails:2.3.8 紅寶石:1.8.7 的RubyGems:1.3.7 雜種:1.1.5
我覺得很奇怪,使用address/imgs/new返回路徑「// new」。我一直在強調這幾天,並找到答案無處可尋。希望有人知道如何解決這個問題,可以指出我在這裏失去的東西。由於提前
你可以發佈'$ rake routes'的輸出嗎?請使用'1010'堆棧溢出格式化按鈕來格式化輸出,以便讀取。 – SooDesuNe 2010-10-12 00:27:47
不幸的是,我不得不使用justhost來處理這個問題,並且必須處理它們和cPanel,所以我的功能有限。我確實有這個穩定的工作在我的本地機器上,當我運行耙子時,一切看起來都正確。有任何想法嗎? – 2010-10-12 00:46:06
請向我們顯示config/routes.rb文件。 – 2010-10-12 00:46:31