0
votes

I want to add the ~/bin folder to my $PATH but everytime I do this and I the use rvm, I get the following warning:

Warning! PATH is not properly set up, '/Users/paulcowan/.rvm/gems/ruby-2.1.2/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-2.1.2'.

I have tried reinstalling rvm with:

rvm get stable --auto-dotfiles

But the warning still persists.

2

2 Answers

0
votes

Don't reinstall, instead fix your PATH.

Run this at the command-line to see your PATH:

echo $PATH

It should list the ~/.rvm path first. If it doesn't then somewhere, in one of your ~/.bashrc, ~/.bash_profile or ~/.profile files your PATH is being manipulated, and RVM's directory is getting buried.

This should be the last line to modify your path:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

This is somewhat like your PATH should look:

/home/ttm/.rvm/gems/ruby-2.1.2/bin:/home/ttm/.rvm/gems/ruby-2.1.2@global/bin:/home/ttm/.rvm/rubies/ruby-2.1.2/bin:/home/ttm/.pyenv/shims:/home/ttm/.pyenv/bin:/home/ttm/perl5/perlbrew/bin:/home/ttm/perl5/perlbrew/perls/perl-5.18.1/bin:/home/ttm/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/opennms/bin:/home/ttm/.rvm/bin

The RVM installation page has troubleshooting tips. It's worth reading.

0
votes

I want to add the ~/bin folder to my $PATH but everytime I do this

And for some reason, you decided that the details of how you are trying to do that are unimportant? Your question is equivalent to asking: I'm trying to output the string "Hello world!" but every time I run my progam, I get an error.

It sounds like you are trying to add ~/bin to the front of the PATH environment variable. Well, why do you think you have to add ~/bin to the front? Why not add it to the end? Open up .bashrc, or equivalent, and add the following line at the top of the file:

PATH="${PATH}:~/bin"
export PATH