Hello, I am developing a rails application and I have certain scripts that I need to have run that have nothing to do with rails and that don''t need to provide any feedback. Basically, I have these ''mechanize'' scripts that will go out and perform some actions but they have nothing to do with the rails application. Right now, the user has to wait for the mechanize scripts to finish because I just call them as a method within my controller. I don''t want to do this anymore. What is the easiest way to just start a standalone ruby script from my rails application. Keep in mind I don''t need any progress reports and I don''t need to know when it finishes. I just need to start the script and that''s it and let it run on its own seperate from rails. How can I achieve this? I do need to pass 2 parameters (string values) to the script. -- 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 -~----------~----~----~----~------~----~------~--~---
On 22 Nov., 11:35, Nathan Esquenazi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: [...]> I don''t want to do this anymore. What is the easiest way to just start a > standalone ruby script from my rails application. Keep in mind I don''t > need any progress reports and I don''t need to know when it finishes. I > just need to start the script and that''s it and let it run on its own > seperate from rails. > > How can I achieve this? I do need to pass 2 parameters (string values) > to the script.The simplest solution might be fork and exec. Something like this should work on Unix/Linux, but probably not on Windows: def some_rails_action fork { exec "some_sript_on_path.rb", "arg1", "arg2" } render_something end HTH, Stefan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Forgot to mention, it would be nice if it was a cross-platform solution as I use windows to develop... Stefan Lang wrote:> On 22 Nov., 11:35, Nathan Esquenazi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > [...] >> I don''t want to do this anymore. What is the easiest way to just start a >> standalone ruby script from my rails application. Keep in mind I don''t >> need any progress reports and I don''t need to know when it finishes. I >> just need to start the script and that''s it and let it run on its own >> seperate from rails. >> >> How can I achieve this? I do need to pass 2 parameters (string values) >> to the script. > > The simplest solution might be fork and exec. Something like this > should work on Unix/Linux, but probably not on Windows: > > def some_rails_action > fork { > exec "some_sript_on_path.rb", "arg1", "arg2" > } > render_something > end > > HTH, > Stefan-- 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 -~----------~----~----~----~------~----~------~--~---
Sounds like you need BackgroundDRb http://backgroundrb.rubyforge.org/ On Nov 22, 5:35 am, Nathan Esquenazi <rails-mailing-l...@andreas- s.net> wrote:> Hello, > > I am developing a rails application and I have certain scripts that I > need to have run that have nothing to do with rails and that don''t need > to provide any feedback. Basically, I have these ''mechanize'' scripts > that will go out and perform some actions but they have nothing to do > with the rails application. Right now, the user has to wait for the > mechanize scripts to finish because I just call them as a method within > my controller. > > I don''t want to do this anymore. What is the easiest way to just start a > standalone ruby script from my rails application. Keep in mind I don''t > need any progress reports and I don''t need to know when it finishes. I > just need to start the script and that''s it and let it run on its own > seperate from rails. > > How can I achieve this? I do need to pass 2 parameters (string values) > to the script. > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---