Can't get RVM to switch rubies

2019-06-24 07:47发布

问题:

How do I explicitly point my fish shell to RVM's version of rubies?

I'm using fish shell and I installed RVM. However, no matter what I do, RVM doesn't want to switch rubies.

rvm rubies

=* ruby-2.3.0 [ x86_64 ]

> ruby -v                                                             
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

> rvm use ruby-2.3.0
Using /Users/.../.rvm/gems/ruby-2.3.0

> ruby -v                                                             
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

my config.fish file contains: rvm default

What am i doing wrong here?

UPDATES:

> which ruby                                                                                                                                         
/usr/bin/ruby

which -a ruby                                                                                                                                      
/usr/bin/ruby

echo $PATH                                                                                                                                         
/usr/local/bin /usr/bin /bin /usr/sbin /sbin

It seems like the path might be wrong, but i'm not sure and not sure how to correct it.

EDIT 2:

Now I changed the path, but it still isn't working:

> echo $PATH                                                          
/Users/.../.rvm/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin

回答1:

Maybe it is a silly observation, but after installing from github:

curl -L --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish

did you configure the rvm defaul like this?:

echo "rvm default" >> ~/.config/fish/config.fish