Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opsworks Rails Console Environment

I am trying to run a rails console in amazon opsworks, I have tried:

sudo rails console -e production
sudo rails console production
RAILS_ENV=production sudo rails console
RAILS_ENV=production RACK_ENV=production sudo rails console

With each of those commands the console is spinning up in the development environment. What do I need to do to get this console started in the environment of my choosing?

like image 988
Aristata Avatar asked Jul 01 '13 19:07

Aristata


2 Answers

sudo su deploy  # switch to the app user
cd /srv/www/myapp/current  # your deploy dir might be different (check logs if unsure)
RAILS_ENV=production bundle exec rails console
like image 140
Joey Avatar answered Nov 03 '22 12:11

Joey


Assuming you are ssh'd into the instance.

$ cd /srv/www/yourapplication/current

$ sudo bundle exec rails console

like image 43
Jacques Betancourt Avatar answered Nov 03 '22 13:11

Jacques Betancourt