We just got our new server(s) up and we're running CentOS on them all. After successfully installing Ruby Enterprise Edition, I would now like to add the REE /bin
(located at /usr/lib/ruby-enterprise/bin
) directory to make it the default Ruby interpreter on the server.
I have tried the following, which only adds it to the current shell session:
export PATH=/usr/lib/ruby-enterprise/bin:$PATH
What would be the correct approach to permanently adding this directory to $PATH
for all users? I'm currently logged in as root
.
Best Answer
It's not a good idea to edit
/etc/profile
for things like this, because you'll lose all your changes whenever CentOS publishes an update for this file. This is exactly what/etc/profile.d
is for:Log back in and enjoy your (safely) updated
$PATH
:Instead of logging back in, you could reload the profile:
This will update the
$PATH
variable.