2011-03-11 58 views
0

我将系统更新为opensuse 11.4,并通过RVM设置了Ruby 1.9.2。我重新安装了所有的宝石和更新的包都没有问题。更新操作系统后的Rails应用程序错误

的问题是模糊的错误运行应用程序时,我得到:

ActionController::RoutingError (undefined method `sub' for nil:NilClass): 
app/controllers/application_controller.rb:1:in `<top (required)>' 
app/controllers/news_controller.rb:1:in `<top (required)>' 

我甚至不知道从哪里开始查找问题。第1行的两个文件都是类声明。即类NewsController < ApplicationController和类ApplicationController < ActionController :: Base。这两个文件都没有方法调用'sub',也没有给出其他信息。

该应用程序的工作完美升级(这是使用Rails 3.0.5还)之前,所以我认为这个问题是某处Rails中,除了一个简单的支架上运行新的应用程序已经没有问题。 news#index是路由文件的根目录,但将根目录更改为其他内容不会执行任何操作。

编辑:

resources :categories,:addresses,:calendars,:topics,:profile,:news,:account_setting 
resources :boards do 
member do 
    get :move 
    post :move_category 
end 
end 


get "user/index" 
get 'login/index' 
get 'login/new' 
post 'login/create' 
post 'login/authenticate' 
get 'login/forgot_password' 
put 'login/reset_password' 

root :to => "news#index" 
+0

你可以发布你的路由文件的地方? –

回答

0

我把它解决了,虽然我不知道什么原因造成的。

我创建了一个新的应用程序和复制应用程序,路线,DB,lib和公共和问题就消失了。

1

没有必要这么做。我认为解决方案可能要简单得多。我刚刚得到了同样的错误。原来我只是有一个名不副实的帮助模块:

module AssetHelper 
    ... 
end 

应该已经

module AssetsHelper 
    ... 
end 
相关问题