I want to create a file my_file.rb inside #{Rails.root}/lib/my_file.rb that executes a script my_script residing in #{Rails.root}/script/my_script. I intend to use it like so:
script/first_script # this first script will call a method in
# lib/my_file.rb that will run the script/my_script file.
How can i create such a lib file that can execute a script? and what is the command to execute a script from a lib file?
popen3approach if you want to do that, as it bypasses the need for intermediate log-files. I've updated my answer.