问题描述
我很平静(回复:rbenv),但我对 rvm & 感到非常沮丧.rvmrc.我一直遇到问题,我 cd 到我的项目文件夹中,却发现我的 ruby &gemset 环境未正确设置.那么有人可以一劳永逸地告诉我如何为我的项目创建一个合适的 .rvmrc.
I come in peace (re: rbenv) but I am super frustrated with rvm & .rvmrc. I keep on running into issues where I cd into my project folder only to find that my ruby & gemset environment has not been set correctly. So can someone once and for all tell me how to create a proper .rvmrc for my project.
我已经尝试了我所知道的两种方式:
I have tried both ways that I know of:
- 创建一个 .rvmrc 并将rvm use 1.9.2@GEMSET"放入其中(有时有效,有时无效)
- 使用 rvm --create --rvmrc 1.9.2@GEMSET 命令行工具创建了一个更精巧的 .rvmrc,但 cd 到我的项目文件夹中仍然没有给我想要的结果.
这个问题是不稳定的.我会说我正在两台不同的机器上工作并通过 Dropbox 同步我的项目文件夹.那么这可能是 rvm 无法验证文件夹并因此忽略 .rvmrc 的问题吗?
This problem is erratic. I will say that I am working on two different machines and syncing my project folder via Dropbox. So could this be a problem where rvm cannot verify the folder and therefore ignores the .rvmrc?
任何帮助将不胜感激.
推荐答案
您可能需要设置
rvm_project_rvmrc=1
在获取 rvm 脚本之前的 shell 配置中,例如:
in your shell config before the rvm scripts are sourced, e.g.:
rvm_project_rvmrc=1
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
这篇关于我无法让 rvm 读取我的项目特定 .rvmrc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!