Changing PATH Environment Variable for all Users. (Ubuntu)

Posted by Wally Glutton on Server Fault See other posts from Server Fault or by Wally Glutton
Published on 2011-03-06T03:28:25Z Indexed on 2011/03/06 8:12 UTC
Read the original article Hit count: 275

I recently compiled Ruby Enterprise Edition (REE) on an Ubuntu 8.04 server.

I would like to update my PATH to ensure this new version of Ruby (found in /opt/ruby_ee/bin) supersedes the older version in /usr/local/bin. (I still want the old version around, though.)

I would like these PATH changes to affect all users and crontabs.

Attempted Solution #1:

The REE documentation recommends placing the REE bin folder at the beginning of the global PATH in /etc/environment. I altered the PATH in this file to read:

PATH="/opt/ruby_ee/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

This did not affect my PATH at all.

Attempted Solution #2:

Next I followed these instructions and updated the PATH setting in /etc/login.defs and /etc/crontab. (I did not change /etc/sudoers.)

This didn't affect my PATH either, even after logging out and rebooting the server.

Other information:

  • I seem to be having the same problem described here.
  • I'm testing using the commands "echo $PATH" and "ruby -v".
  • My shell is bash. My .bashrc doesn't override my PATH.
  • Yes, I have heard of the Ruby Version Manager project. ;)

© Server Fault or respective owner

Related posts about ubuntu

Related posts about ruby