Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need the command 'rails' to be added permanently to the PATH variable. I'm not sure if this should be happening automatically, as every rails guide seem to assume doing 'rails something' will work right after installing it. The same happened with other programs, so I think I'm the problem.

I searched this but I found many options, not sure which is the most appropriate way:

option 1) edit ~/.bashrc

option 2) edit ~/.profile

option 3) put a script into /etc/profile.d/

I haven't tried them yet, I don't want to make a mess in the system.

Any suggestions?

ps. I'm on Ubuntu 11 server edition 64 bits

My final choice: I used ~/.bashrc for the sake of simplicity, I only needed to open a new terminal after adding the path

share|improve this question
up vote 2 down vote accepted

If you connect the machine remotely using console, then .bash_profile is used. But if you're already logged into the machine and just open a new terminal window, then .bashrc is used. You might also find some useful info here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.