我不知道为什么,但 RVM 似乎无法更改默认的 Ruby。我正在使用 Oh My Zsh 并尝试了我发现的所有内容,但似乎没有任何效果。
➜ Sites rvm use 2.0.0 --default
Using /Users/anahkiasen/.rvm/gems/ruby-2.0.0-p247
➜ Sites rvm list
rvm rubies
=* ruby-2.0.0-p247 [ x86_64 ]
# => - current
# =* - current && default
# * - default
➜ Sites rvm reload && rvm list
RVM reloaded!
rvm rubies
* ruby-2.0.0-p247 [ x86_64 ]
# => - current
# =* - current && default
# * - default
现在 Ruby 设置为默认值,但 RVM 不会将其加载为“当前”,这意味着它不会加载附属于它的 gemset。
➜ Sites rvm use 2.0.0
Using /Users/anahkiasen/.rvm/gems/ruby-2.0.0-p247
➜ Sites gem list
*** LOCAL GEMS ***
backports (3.3.3)
bson (1.9.1)
bson_ext (1.9.1)
bundler (1.3.5)
bundler-unload (1.0.1)
eventmachine (1.0.3)
genghisapp (2.3.7)
json (1.8.0)
mongo (1.9.0)
mustache (0.99.4)
rack (1.5.2)
rack-protection (1.5.0)
rack-test (0.6.2)
rake (10.1.0)
rubygems-bundler (1.2.2)
rvm (1.11.3.8)
sass (3.2.10)
sass-globbing (1.1.0)
sinatra (1.4.3)
sinatra-contrib (1.4.0)
sinatra-mustache (0.1.0)
tilt (1.4.1)
vegas (0.1.11)
➜ Sites rvm reload && gem list
RVM reloaded!
*** LOCAL GEMS ***
Nothing.
我没有.bashrc
也没有.bash_profile
。我的没有 RVM 参考,.zprofile
这是我的.zshrc
:
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="robbyrussell"
DEFAULT_USER="anahkiasen"
# Uncomment following line if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
plugins=(git bower brew composer gem laravel sublime)
## RVM and Rubygems
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
source $ZSH/oh-my-zsh.sh
我尝试交换上述两行,尝试将 RVM 加载移动到.zprofile
,什么都没有。每次我打开一个新的终端实例时,默认值就消失了。它加载了正确的 ruby,这意味着如果我ruby -v
得到了我想要的版本,但对于 RVM,它没有加载,因此我没有任何 gemset。
我也试过rvm --default use 2.0.0
,rvm use 2.0.0@develop --default
但结果一样。
我已经重新安装了 RVM,我已经递归地将.rvm
文件夹的权限设置为当前用户,什么都没有。
那一刻我有点绝望。