Search code examples
ruby-on-rails-3opensuseupdating

Rails app error after updating OS


I updated my system to opensuse 11.4 and set up Ruby 1.9.2 via RVM. I reinstalled all the gems and updated bundle all without issue.

The problem is the vague error I get when running the app:

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)>'

I don't even know where to start looking for the problem. Both files on line 1 is the class declaration. ie class NewsController < ApplicationController and class ApplicationController < ActionController::Base. Neither files have a method call to 'sub' and no other information is given.

The app worked perfectly before the upgrade (which was using Rails 3.0.5 also) so I think the issue is somewhere in Rails, except running a new application with a simple scaffold has no problems. news#index is root in the routes file, but changing root to something else does nothing.

EDIT:

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"

Solution

  • I got it resolved, although I don't know what caused it.

    I created a new app and copied over app, routes, db, lib, and public and the problem disappeared.