尝试访问我的页面时出现路由错误。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