43

Recently I tried to update my ruby version due to a warning message (see below).

Now I get the following warning message when I start my iterm2:

Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:
    https://github.com/wayneeseguin/rvm/issues/3212

Does anyone know how to resolve this warning? It hasn't really impacted my work but it is a little unsettling.

for your information:
1. I believed I ran rvm get stable to get the latest ruby version.
2. this is the warning message I was initially trying to resolve but it has not been resolved either:

warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.5-compliant syntax, but you are running 2.1.2.

I am using 1. Mac OS X 2. iterm2 and 3.oh-my-zsh shell

echo
  • 900
  • 1
  • 9
  • 17

8 Answers8

116

I had same issue with oh-my-zsh While installing rvm with option --rails, there was this warning:

This solution works for me: Open .zshrc file, and find PATH line

change

export PATH=/path/to/something

into

export PATH="$PATH:/path/to/something"

save it and do source ~/.zshrc, Then it worked.

Abram
  • 39,950
  • 26
  • 134
  • 184
ymin
  • 1,384
  • 1
  • 10
  • 7
10

If you find a line after User configuration in the ~/.zshrc file like this:

#export PATH="/Users/robinwen/.rvm/gems/ruby-1.9.3-p551@robin/bin:/Users/robinwen/.rvm/gems/ruby-1.9.3-p551@global/bin:/Users/robinwen/.rvm/rubies/ruby-1.9.3-p551/bin:/Users/robinwen/.rvm/bin:/usr/local/git/bin:/sw/bin:/usr/local/bin:/usr/local:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/"

You should comment this line, and add following line:

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

Good luck!

robinwen
  • 852
  • 10
  • 10
5

Adding to @ymin's solution. For me, who ran rvm list and did not have a current ruby selected, needs to manually select a ruby ie. rvm use ruby-2.1.x, then fix zshrc path and run rvm get stable.

maxhungry
  • 1,863
  • 3
  • 20
  • 28
3

As of Dec 19, 2014, sudo rvm shows these PATH warnings when the root user's default shell is not supported.

In this case of running sudo rvm the solution is to use rvmsudo.

leoj
  • 1,307
  • 10
  • 20
2

same issue here, add code below into ~/.zshrc works for me.

export GEM_HOME="$GEM_HOME:$HOME/.rvm/bin"
export GEM_PATH="$GEM_PATH:$HOME/.rvm/bin"

And then source ~/.zshrc.

idsbllp
  • 836
  • 9
  • 8
1

I have the same question

my solution method is add

source /etc/profile.d/rvm.sh

in .zshrc

source .zshrc is ok

good luck for you!

张华轩
  • 11
  • 2
1

After adding [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" to the top of ~/.zshrc rather than the bottom I can confirm this has solved the issue for me.

JayKan
  • 3,966
  • 2
  • 20
  • 21
0

I recently was facing this issue, every time I would use rvm or open a new terminal, I used to get this warning I tried playing around with

.bash_profile and .bashrc files but nothing was working

Even tried the commands - rvm get stable --auto-dotfiles and rvm reset but these also did not work

turns out I had many paths defined in the

~/.zshrc file

there were multiple entries for rvm, so comment out and added just one -:

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