Reputation: 501
I'm upgrading an existing application to Rails 3.1 but get the following errors when trying to view a page.
In the log I get:
cache: [GET /assets/jquery.js?body=1] miss, store
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at Wed Sep 14 15:35:32 +0100 2011
Served asset /jquery.js - 200 OK (0ms)
[2011-09-14 15:35:32] ERROR NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/rack-1.3.2/lib/rack/handler/webrick.rb:71:in `service'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/jamessmith/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/rack-1.3.2/lib/rack/handler/webrick.rb:13:in `run'
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/rack-1.3.2/lib/rack/server.rb:265:in `start'
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.1.0/lib/rails/commands/server.rb:70:in `start'
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.1.0/lib/rails/commands.rb:54
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
/Users/jamessmith/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.1.0/lib/rails/commands.rb:49
script/rails:6:in `require'
script/rails:6
I get that for every CSS and JavaScript asset.
When I try to view the asset in a browser window I get:
Internal Server Error
You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each
WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30) at localhost:3000
Upvotes: 2
Views: 509
Reputation: 501
In the end I had to do a rake rails:update
and update each of the files it found conflicts with, making sure to check the difference between the old and new files then updating them appropriately.
Upvotes: 1