Error message: -bash: /etc/profile.d/rvm.sh: No such file or directory

May 19, 2013 in answer

0 votes, 0.00 avg. rating (0% score)

ANSWER:

Every time you start Terminal or a new tab in Terminal, you begin a bash shell session. You can set some commands to run every time you start a bash session. Typical use cases include setting some aliases (e.g. gst for git status), environment variables, and running other bash scripts. The place to put these initial bash commands is usually in ~/.bashrc or ~/.bash_profile. Start by checking those files to see if you have any reference to the file /etc/profile.d/rvm.sh. Also, check whether said file actually exists on your machine. If it doesn’t, you can probably safely delete the corresponding line from your bashrc or bash_profile. If it does exist, there’s something else funny going on which you’ll have to debug.

Also note, the way RVM works, it requires you to run a certain script every time. If you have RVM and plan on using it, does it work? If not, you might need to find where the appropriate RVM script lives on your machine and add something to your bashrc or bash_profile that runs the script. Normally when you install RVM it tells you what command to add and where. For example by ~/.bashrc file includes the following command:

[[ -s "/Users/amitgupta/.rvm/scripts/rvm" ]] && source "/Users/amitgupta/.rvm/scripts/rvm"

which checks that the rvm script exists, is a non-empty file, and then runs it.

Amit Kumar Gupta from http://stackoverflow.com/questions/16631432