rvm 一直忽略我的 .rvmrc
我的项目遇到一些问题。我在项目目录中保留了一个 .rvmrc
,配置如下:
rvm use 1.9.2
并将以下行放入我的 ~/.zshrc:
rvm_project_rvmrc=1
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
然而,每当我 cd
进入我的项目目录时,ruby -v
显示 ruby 1.8.7 (2010-01-10 patchlevel 249)[通用-darwin11.0]
。
我在这里缺少什么?
I'm having some problems with my project. I keep an .rvmrc
in my project's directory with the following config:
rvm use 1.9.2
and I put the following lines into my ~/.zshrc
:
rvm_project_rvmrc=1
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
Yet whenever I cd
into my project's directory, ruby -v
shows ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
.
What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另一件事可能是 rvm 不信任您的 rvmrc。请使用
rvm rvmrc trust DIR 再次手动信任它
Another thing could be that rvm doesn't trust your rvmrc. Please trust it manually again with
rvm rvmrc trust DIR
更新后,RVM 似乎忽略了我所有的 .rvmrc 文件。我最终通过跑步让它开始工作
After an update, RVM seemed to be ignoring all my .rvmrc files. I eventually got it to work by running
你确定rvm加载正确吗?根据文档
类型 rvm | head -1
应该显示
rvm 是一个函数
您
~/.zshrc
中引用的 rvm 脚本仅在存在时才会执行。否则它会被默默地跳过。Are you sure rvm is loaded correctly? According to the docs
type rvm | head -1
should show
rvm is a function
The rvm script referenced in you
~/.zshrc
is only executed if it exists. Otherwise it's skipped silently.设置
rvm_project_rvmrc=1
可能仅在您的 .zshrc 中有效,请尝试将其导出到环境中:export rvm_project_rvmrc=1
Setting
rvm_project_rvmrc=1
probably only works within your .zshrc, try exporting it to the environment:export rvm_project_rvmrc=1