stephenmurdoch stephenmurdoch - 1 year ago 54
Ruby Question

RVM not reading .ruby-gemset files when I open a new tab in my terminal

I have a new install of RVM on Fedora 20.

If I cd to myapp, RVM will read the .ruby-gemset file and switch to the appropriate gemset, but if I open a new tab (control-shift-t) and run

rvm gemset list
I find that it's using the default gemset.

Does any have any idea what I might be doing wrong?

I've got the following in .bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc


export PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

And I've got more ore less identical content in .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc


export PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

The terminal is the bog standard one that comes with Fedora.

Answer Source

I had the same issue, and I was able to fix it. However, my exact solution might be useless for you. I had oh-my-zsh installed. It looks like during installation, it was trying to mimic my .bashrc files and it screwed PATH variable for me. Here's the line I had trouble with:

export PATH="/home/alexander/.rvm/gems/ruby-2.1.1@security/bin:/home/alexander/.rvm/gems/ruby-2.1.1@global/bin:/home/alexander/.rvm/rubies/ruby-2.1.1/bin:/home/alexander/.nvm/v0.10.25/bin:/home/alexander/work/gc-sdk/google-cloud-sdk/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/alexander/.rvm/bin"

So, you need to verify if your PATH variable isn't tempered with. And you need to let RVM configure it for you. Both these things can be done with a simple command in your terminal (assuming you have RVM installed):

rvm get stable --auto-dotfiles

Also, there're couple of issues created on GitHub. The common advice is to use command from above and switch your terminal to login shell.

Hope it helps!