Running Rails console

You can easily run Rails console with a single command

Start by SSHing to your server. Then go to your STACK_PATH (eg. cd $STACK_PATH) and run the following command:

$ bundle exec rails c <environment>

Possible values for <environment>:

  • development (default)
  • test
  • production

To run your Rails console as the Nginx user, you can use the following command:

$ sudo -u nginx bash -c 'source /var/.cloud66_env && bundle exec rails c'

the ssh link doesn’t work?

How would I do this in a single line command run locally? Is there a way to pass a command to cx ssh that will be run after the connection is established?

 

You must be logged in to comment on this article