默认情况下如何使鱼壳使用rvm红宝石 [英] How to make fish shell use an rvm ruby by default
问题描述
我在Mac OS X 10.9.1上使用fish shell 2.10.我想使用我在终端中使用RVM作为默认安装的Ruby,但是我似乎无法使它正常工作.
I'm using fish shell 2.10 on Mac OS X 10.9.1. I would like to use a Ruby that I have installed using RVM as the default in my terminals, however I can't seem to make this work.
我尝试过rvm use 2.1.0 --default
,但是在打开新终端后,我仍然得到以下信息:
I've tried rvm use 2.1.0 --default
but upon opening a new terminal I still get the following:
> which ruby
/usr/bin/ruby
运行rvm
命令会导致加载红宝石:
Running the rvm
command causes the ruby to be loaded:
> which ruby
/usr/bin/ruby
> rvm
[...]
> which ruby
/Users/alex/.rvm/rubies/ruby-2.1.0/bin/ruby
但是每次我打开新终端时都必须这样做很烦人.
But it's annoying to have to do this every time I open a new terminal.
推荐答案
首先从 rvm.io
curl -L --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish
重新打开终端后,您现在应该可以在fish中使用rvm命令了.
You should now be able to use rvm command in fish after reopening terminal.
运行以下命令,将rvm default
行添加到您的fish的配置文件中.
Run the following to add the line rvm default
to your fish config file.
echo 'rvm default' >> ~/.config/fish/config.fish
重新打开终端后,您现在应该可以使用与ruby相关的二进制文件和宝石.
You should now be able to use ruby related binaries and gems after reopening terminal.
这篇关于默认情况下如何使鱼壳使用rvm红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!