我将系统更新为 opensuse 11.4 并通过 RVM 设置 Ruby 1.9.2。我重新安装了所有的 gem 并更新了 bundle 都没有问题。
问题是我在运行应用程序时遇到的模糊错误:
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
在路由文件中是 root,但是将 root 更改为其他内容不会执行任何操作。
编辑:
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"