Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run rake task from outside RAILS_ROOT

My RAILS_ROOT is /usr/local/www/application/

If I run 'rake db:migrate RAILS_ENV=production" from within the RAILS_ROOT it works fine.

However I can't seem to find a way to run the same command from outside the RAILS_ROOT.

like image 599
Anand Shah Avatar asked Dec 05 '22 05:12

Anand Shah


1 Answers

Try:

rake -f $RAILS_ROOT/Rakefile db:migrate RAILS_ENV=production
# Assuming you set the environment variable. 
# Else, just replace $RAILS_ROOT by actual value
like image 77
Swanand Avatar answered Dec 21 '22 13:12

Swanand