forgot password?


   
 
git version: NoMethodError in TodosController
Posted: 25 January 2011 10:39 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  11
Joined  2010-03-18

Hi

After a ‘git pull’ a few days ago, the newest version does not work anymore.

I am seeing the following error message:

Processing TodosController#index (for 198.240.213.23 at 2011-01-25 11:10:21) [GET]                                                   
                                                     
NoMethodError (undefined method `locale’ for #<ActiveRecord::Associations::HasOneAssociation:0x5695da34>):                                   
  app/controllers/application_controller.rb:54:in `set_locale’           
  /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request’                                                 
  /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop’                                                 
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler’                                         
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application’                                       
  /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork’         
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application’                                       
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__’   
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop’   
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously’                                                 
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start’     
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start’                                                   
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application’                                               
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add’                                             
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application’                                               
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize’                                               
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize’                                               
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application’                                               
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application’                                                   
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application’                                               
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__’   
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop’   
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously’                                                 
  /usr/lib/phusion_passenger/passenger-spawn-server:61                
                                                     
Rendering /srv/rails/dev/tracks/public/500.html (500 Internal Server Error)   

I am running rails 2.3.5-1~bpo50+1 and libapache2-mod-passenger 2.2.11debian-1~bpo50+1 on debian lenny.

I have already tried to ‘git clone’ again but the result is the same.

Cheers, David

Profile
 
 
Posted: 25 January 2011 03:16 PM   [ Ignore ]   [ # 1 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

I think you forgot to run

rake db:migrate

to apply the database changes for i18n changes.

Profile
 
 
Posted: 25 January 2011 04:04 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  11
Joined  2010-03-18

That was it.
Thanks a lot!

Profile
 
 
Posted: 14 March 2011 01:36 AM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  4
Joined  2010-09-13

Running db:migrate did not fix this error for me. It is exactly the same error as shown above, after the same upgrade. I have migrated the database (with no errors), restarted apache (twice), touched restart.txt (several times), and generally tried to force this error to go away. But no dice.

Suggestions?

(By the way, there is a bit of weirdness here. When I start the older version—which I just renamed into a backup directory, so that I could restore it by renaming it back to the currently active directory—tracks starts up fine and shows version 1.7.2. This is after the db:migrate. So, I wonder if the problem is not in the database but in the directory structure of the version I just cloned from github. This is all happening on a turnkeylinux ubuntu server.)

Ross

Profile
 
 
Posted: 28 March 2011 10:38 AM   [ Ignore ]   [ # 4 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

Strange, I was mailed about your reply. Sorry I didn’t notice it earlier.

If you have the exact same error message, your database was not migrated. Try

rake db:migrate RAILS_ENV=production

to make sure you are migrating your production database.

btw, the version number is not stored in the database, but in the app (in config/environment.rb). So running your backup will show the version of the backup (1.7.2), not the version of your db

Profile
 
 
Posted: 28 March 2011 10:39 AM   [ Ignore ]   [ # 5 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

i was _not mailed I mean grin

Profile
 
 
Posted: 01 April 2011 10:11 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  4
Joined  2010-09-13

Thanks for the reply.

rake db:migrate RAILS_ENV=production 

seems to work fine now. I must have missed a step somewhere. But all seems good now.

Profile
 
 
Posted: 11 April 2011 05:08 PM   [ Ignore ]   [ # 7 ]  
Newbie
Rank
Total Posts:  11
Joined  2011-04-04

I had this same error after I finally got past the datanoise-actionwebservice problem with the latest update from Reinier.

Running rake db:migrate RAILS_ENV=production fixed it for me, but the strange this is that I already ran this on the original download I had…. not sure why it didn’t take the first time, but all is well now.

G

Profile
 
 
Posted: 12 April 2011 08:47 AM   [ Ignore ]   [ # 8 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

by default if you run rake db:migrate it will migrate your development database. Adding RAILS_ENV=production will point rake to your production database… maybe you forgot the RAILS_ENV part the first time?

Profile
 
 
Posted: 12 April 2011 09:08 AM   [ Ignore ]   [ # 9 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

of your initial rake failed on the actionwebservice issue

Profile