1

I just ran 'rvm get stable' to be given the below error;

Warning! PATH is not properly set up, '/Users/jamesbkemp/.rvm/gems/ruby-2.2.1/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.2.1'.

Previous to running 'rvm get stable' I ran 'brew upgrade ruby' to Ruby 2.2.2.

'echo $PATH' returns the below:

/usr/local/heroku/bin:/Users/user/.rvm/gems/ruby-2.2.1/bin:/Users/user/.rvm/gems/ruby-2.2.1@global/bin:/Users/user/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/user/.rvm/bin:/Users/user/.rvm/bin

I don't understand what the issue is here or why when i run 'ruby -v' it returns 'ruby 2.2.1p85'.

Running 'rvm list' returns the below, as well as the same PATH error message detailed above;

ruby-2.0.0-p353 [ x86_64 ]
   ruby-2.0.0-p451 [ x86_64 ]
   ruby-2.1.0 [ x86_64 ]
   ruby-2.1.5 [ x86_64 ]
=* ruby-2.2.1 [ x86_64 ]
   ruby-2.2.2 [ x86_64 ]

Can anyone help?

jbk
  • 1,911
  • 19
  • 36
  • Have you tried running `rvm reset`? – bigtunacan Apr 11 '16 at 15:36
  • No, I've done nothing other than the above. Is this the command I should run once I've updated a newer version of Ruby (via Homebrew)? – jbk Apr 11 '16 at 15:38
  • Possible duplicate of [Getting "Warning! PATH is not properly set up" when doing rvm use 2.0.0 --default](http://stackoverflow.com/questions/18276701/getting-warning-path-is-not-properly-set-up-when-doing-rvm-use-2-0-0-defaul) – bigtunacan Apr 11 '16 at 15:40
  • That question's answers has not solved the issues I have. I have not run 'rvm use ruby-2.2.1' as I just brew installed Ruby 2.2.2 and want to run that. – jbk Apr 11 '16 at 15:51
  • 1
    Thats not was he meant. You should run `rvm use ruby-2.2.2` because ruby-2.2.1 is still selected. This should change the PATH and those eliminate the warning. – makadev Apr 11 '16 at 16:02
  • Essentially a lack of a clear understanding of the difference between RVM and Homebrew has lead to my confusion here. 'rvm use ruby-2.2.2' has my system now using the most recent version. Thank you. – jbk Apr 11 '16 at 16:10

1 Answers1

0

Put RVM code at the start of $PATH

I just had the same problem. I went to terminal and entered subl ~/ which opens up your home folder on Sublime Text (or you can use another text editor).

I then clicked on every file starting with ., e.g. .bash_profile, .bashrc, .mkshrc, .zshrc

Whenever I saw this line:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

I changed it to this:

export PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting

That way, the RVM code is at the start of $PATH. Then I quit Terminal and started it up again to make sure those config files were loaded.

Community
  • 1
  • 1
Mirror318
  • 11,875
  • 14
  • 64
  • 106