posted this on Ruby forum, no luck there - maybe a Railser has dealt with this issue... I''ve made a rake task that I''m running from my rails, and it works - but only once. If I then restart the server (mongrel) it works again - once. I can simulate this in the console session as shown... q = Rake::Task["cache_sweeper"] => <Rake::Task cache_sweeper => []> >> q.invoke => [#<Proc:0xb6d03444@./script/../config/../config/../lib/tasks/cache.rake:4>] >> q = Rake::Task["cache_sweeper"] => <Rake::Task cache_sweeper => []> >> q.invoke => nil >> ... when q.invoke returns the "[#Proc:..." it has worked correctly, nil means nothing happened. Any one have insight to what is happening with rake? Thank you, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I was having this problem just last night with a migration. I don''t know why it happens, but I can tell you how I got around it: I changed the iteration number of the migration file itself. In other words, I had a file called 001_create_schedules.rb; I renamed the file to 002_create_schedules.rb. I guess that is more of a workaround than a solution, but it might keep you running in the meantime until you can get a more in-depth response here in the forum (I''m a newbie too). -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
that sounds like your schema table had indexed to 1, which would mean it won''t run the "001_xxx" migration again unless you rollback to version 0, or manually change the schema table value to 0 I''ve embedded a call to a rake task with a controller action, this rake task only runs the first time it is called. Sara Me wrote:> I was having this problem just last night with a migration. I don''t > know why it happens, but I can tell you how I got around it: I changed > the iteration number of the migration file itself. In other words, I > had a file called 001_create_schedules.rb; I renamed the file to > 002_create_schedules.rb. > > I guess that is more of a workaround than a solution, but it might keep > you running in the meantime until you can get a more in-depth response > here in the forum (I''m a newbie too).--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Can rails environments be loaded only once and then execute rake tasks without loading it again and again?
- rake doc:rails fails with edge rails
- Rails problems running rake and other tasks - undefined method `action_controller'
- ''rake rails:update'' Error - can''t upgrade to 1.1.1
- wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3