Skip to content

Instantly share code, notes, and snippets.

@alexvbush
Created July 19, 2011 22:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save alexvbush/1093862 to your computer and use it in GitHub Desktop.
Save alexvbush/1093862 to your computer and use it in GitHub Desktop.
How to run Perl and Python scripts in a Rails app.
#This will run Perl and Python scripts respectively in Rails console using 'gem escape'. Gem Escape allows to format path to the scripts properly.
perl_cmd = Escape.shell_command(['perl', "#{RAILS_ROOT}/bin/test_perl_script.pl"]).to_s
system perl_cmd
python_cmd = Escape.shell_command(['python', "#{RAILS_ROOT}/bin/test_python_script.py"]).to_s
system python_cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment