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

4

5

I keep getting this error every time I open my terminal:

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

This started happening after I recently installed zsh (oh-my-zsh)

I do not know how to set the path to GEM_HOME and/or GEM_PATH.

Ieyasu answered 27/1, 2015 at 6:18 Comment(1)
Have you completely read the RVM installation documentation? How about Zsh?Sphenoid
N
26

I am also faced same problem, change the following line in .zshrc,

export PATH="/usr/local/heroku/bin: .........."

to

export PATH="$PATH:/usr/local/heroku/bin: .........."

this works for me.

Thanks

Nootka answered 5/2, 2015 at 10:2 Comment(0)
S
0

oh-my-zsh & rvm & nvm

Same problem,take me several days. Finally I just comment out the lines override the PATH,and load rvm and nvm in my .zshrc file. All the issues gone.

Here is my .zshrc file:


# User configuration

# export PATH="$PATH:/Users/xxx/.rvm/gems/ruby-2.1.1/bin:/Users/xxx/.rvm/gems/ruby-2.1.1@global/bin:/Users/xxx/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxx/.rvm/bin"

# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

export NVM_DIR="/Users/xxx/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

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

Hope it's useful!

Schlosser answered 16/5, 2016 at 7:34 Comment(0)
M
0

Try commenting out from your .zlogin (or similarly named .zXYZ) file, located in the same home directory as the .zshrc file

It appears my .zsh cli was trying to load RVM into a shell session as a function.

This was not obvious from within the .zshrc file, but rather in a file called .zlogin (This may be different on your system.)

After playing with me .zshrc file and adjusting all the things suggested here and elsewhere, I saw I had a .zlogin file, which had what I believe is the problem:[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function

I commented out the line and the problem resolved (aka the recurring error message whenever opening zsh cli command line). Know let's see if this broke something else...

Mainland answered 4/10, 2020 at 13:36 Comment(0)
A
0

The error message here shows that while your PATH is set to use RVM's Ruby, the GEM_HOME and/or GEM_PATH environment variables are not set. These variables are important because they tell Ruby where to install and look for gems.

To fix this, you need to set the GEM_HOME and GEM_PATH environment variables. You can do this by adding the following lines to your shell profile file (like .bashrc, .bash_profile, or .zshrc):

export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"

After adding these lines, you need to source your shell profile file to apply the changes:

source ~/.bashrc # or
source ~/.bash_profile # or
source ~/.zshrc

Then, you can check if the environment variables are set correctly by running:

echo $GEM_HOME
echo $GEM_PATH

If everything is set up correctly, both commands should output the path to your .gem directory.

Annapolis answered 13/3 at 6:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.