Sam Kong
2006-Nov-06 21:25 UTC
What should I require to use rails application in my script
Hi, I have my rails application. It works in script/console. How can I make it work in my own ruby script? What should I require? Thanks. Sam -- 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 -~----------~----~----~----~------~----~------~--~---
Alex Wayne
2006-Nov-07 06:26 UTC
Re: What should I require to use rails application in my scr
Sam Kong wrote:> Hi, > > I have my rails application. > It works in script/console. > How can I make it work in my own ruby script? > What should I require? > > Thanks. > > Samconfig/environment.rb I think -- 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 -~----------~----~----~----~------~----~------~--~---
David Fitzgibbon
2006-Nov-07 09:09 UTC
Re: What should I require to use rails application in my scr
Sam Kong wrote:> Hi, > > I have my rails application. > It works in script/console. > How can I make it work in my own ruby script? > What should I require? > > Thanks. > > SamI think the correct way would be to run your script as follows: ruby script/runner ''load "<path_to_your_script>/your_script.rb"'' Hope that helps, Dave. -- 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 -~----------~----~----~----~------~----~------~--~---