我不知道为什么,但是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
Run Code Online (Sandbox Code Playgroud)
现在,将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.
Run Code Online (Sandbox Code Playgroud)
我没有.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
Run Code Online (Sandbox Code Playgroud)
我尝试交换以上两行,尝试将RVM加载移至.zprofile,什么也没有。每次打开终端的新实例时,默认设置都消失了。它加载了正确的红宝石,这意味着如果我可以ruby -v得到想要的版本,但是对于RVM,则不会加载它,因此我没有任何宝石集。
我也尝试过rvm --default use 2.0.0,rvm use 2.0.0@develop --default但结果相同。
我已经重新安装了RVM,并递归设置了该.rvm文件夹对当前用户的权限,什么也没有。
那时候我有点绝望。
当您使用OH-MY-ZSH时,您可能会遇到类似以下的问题:https : //github.com/robbyrussell/oh-my-zsh/pull/1359
RVM具有“修复”功能,运行:
rvm get head --auto-dotfiles
Run Code Online (Sandbox Code Playgroud)
这将重新组织您的点文件-阅读输出并按照说明进行操作很重要。
确保使用登录Shell以获得最佳效果。
| 归档时间: |
|
| 查看次数: |
1824 次 |
| 最近记录: |