Alex Rivera | Logout

Is there a way to use capistrano (or similar) to remotely interact with rails console

Asked 2010-12-03T16:49:14.503
10

I'm loving how capistrano has simplified my deployment workflow, but often times a pushed change will run into issues that I need to log into the server to troubleshoot via the console.

Is there a way to use capistrano or another remote administration tool to interact with the rails console on a server from your local terminal?

**Update:

cap shell seems promising, but it hangs when you try to start the console:

cap> cd /path/to/application/current
cap> pwd
 ** [out :: application.com] /path/to/application/current
cap> rails c production
 ** [out :: application.com] Loading production environment (Rails 3.0.0)
 ** [out :: application.com] Switch to inspect mode.

if you know a workaround for this, that'd be great

Edit
Report

1 Answer

0

cap -T

cap invoke                        # Invoke a single command on the remote ser...
cap shell                         # Begin an interactive Capistrano session.

cap -e invoke

------------------------------------------------------------
cap invoke
------------------------------------------------------------
Invoke a single command on the remote servers. This is useful for performing
one-off commands that may not require a full task to be written for them. Simply
specify the command to execute via the COMMAND environment variable. To execute
the command only on certain roles, specify the ROLES environment variable as a
comma-delimited list of role names. Alternatively, you can specify the HOSTS
environment variable as a comma-delimited list of hostnames to execute the task
on those hosts, explicitly. Lastly, if you want to execute the command via sudo,
specify a non-empty value for the SUDO environment variable.

Sample usage:

  $ cap COMMAND=uptime HOSTS=foo.capistano.test invoke
  $ cap ROLES=app,web SUDO=1 COMMAND="tail -f /var/log/messages" invoke
answered 2010-12-03T18:15:32.203

Your Answer