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.
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:
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: