Run a script on the server

Updated . Posted . Visible to the public.

You have to specify the environment with -e env_name or RAILS_ENV=env_name if you want to run a script on the server.

at Rails 2 it's script/runner

bundle exec script/runner -e env_name path/to/script.rb argument1 argument2 ...

at Rails 3 it's rails runner

RAILS_ENV=env_name bundle exec rails runner path/to/script.rb argument1 argument2 ...
Martin Straub
Last edit
Keywords
execute
License
Source code in this card is licensed under the MIT License.
Posted by Martin Straub to makandra dev (2011-11-14 11:41)