Topic: Configuring sudo PATH in Capistrano Deployments

Topic type:

How to add paths to Capistrano's sudo command (useful for ruby enterprise edition installs)

Enable User Environments

Edit /etc/ssh/sshd_config and add the following to the bottom of the file:

PermitUserEnvironment yes

Then reboot sshd by running:

/etc/init.d/ssh reload

Configuring the PATH

Create (if it doesn't already exist) and open .ssh/environment, and put something like this inside (edit the ree path if you have one).

PATH=/opt/ree-latest/bin:/var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

Now any capistrano sudo commands will use ree instead of the default ruby on the system.

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Tags

Tags: capistrano, sudo, ssh

Creative Commons Attribution-Share Alike 3.0 New Zealand License
Configuring sudo PATH in Capistrano Deployments by Kieran P is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License