Raj Singh
2007-Dec-26 23:51 UTC
How to set environment when calling rake task inside another
This is what I have inside a rake task. In this rake task I need to call another rake task called email:send_messages. However I need to pass the RAILS_ENV as ''staging''. Rake::Task["rake:email:send_messages"].invoke I tried a lot of variations but none of them work. Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging Rake::Task["rake:email:send_messages RAILS_ENV=staging"].invoke Any thoughts. -- 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 -~----------~----~----~----~------~----~------~--~---
gemblon (t.b.)
2007-Dec-27 00:05 UTC
Re: How to set environment when calling rake task inside ano
Raj Singh wrote:> This is what I have inside a rake task. In this rake task I need to call > another rake task called email:send_messages. However I need to pass the > RAILS_ENV as ''staging''. > > Rake::Task["rake:email:send_messages"].invoke > > I tried a lot of variations but none of them work. > > Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging > Rake::Task["rake:email:send_messages RAILS_ENV=staging"].invoke > > Any thoughts.ask fred. he is guru. we needs an ''ASK FRED'' web site. lol. -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Dec-27 00:18 UTC
Re: How to set environment when calling rake task inside another
On 26 Dec 2007, at 23:51, Raj Singh wrote:> > This is what I have inside a rake task. In this rake task I need to > call > another rake task called email:send_messages. However I need to pass > the > RAILS_ENV as ''staging''. > > Rake::Task["rake:email:send_messages"].invoke > > I tried a lot of variations but none of them work. > > Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging > Rake::Task["rake:email:send_messages RAILS_ENV=staging"].invoke >Random guess: set ENV[''RAILS_ENV''] before you invoke that rake task. Fred> Any thoughts. > -- > 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 -~----------~----~----~----~------~----~------~--~---