【发布时间】:2011-06-20 18:57:34
【问题描述】:
我已经安装了 RVM 来更新和运行不同的 ruby 和 rails。安装后,我收到更新 shell 加载文件的消息。
1) 将以下行放在 shell 加载文件的末尾 (.bashrc 或 .bash_profile 用于 bash 和 .zshrc 用于 zsh), 毕竟 PATH/变量设置:
[[ -s "/Users/eric/.rvm/scripts/rvm" ]] && source "/Users/eric/.rvm/scripts/rvm" # This loads RVM into a shell session.
You only need to add this line the first time you install rvm.
我输入了[[ -s "/Users/eric/.rvm/scripts/rvm" ]] && source "/Users/eric/.rvm/scripts/rvm"
然后按回车键。这会更新我的文件吗?还是我必须打开某种类型的文件并剪切和粘贴代码?
由于我在安装后的第 2 部分中没有看到任何通知,因此我关闭了 shell 并打开了一个新的。但 RVM 命令似乎不起作用。安装后说明的第 2 部分是:
2) 确保 ~/.bashrc 文件中没有“返回”, 否则 rvm 可能无法正常工作。
这意味着如果您看到类似的内容:
'[ -z "$PS1" ] && return'
然后你将这一行改为:
如果 [[ -n "$PS1" ]] ;那么
# ... original content that was below the '&& return' line ...
fi #
# 这是获取 rvm v v v 的好地方 [[ -s "/Users/eric/.rvm/scripts/rvm" ]] && source "/Users/eric/.rvm/scripts/rvm" # 这会将 RVM 加载到 shell 会话中。
EOF - 这标志着 .bashrc 文件的结束
Be absolutely *sure* to REMOVE the '&& return'.
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
Placing all non-interactive (non login) items in the .bashrc,
including the 'source' line above and any environment settings.
感谢您的帮助,因为我是新手,正在尝试学习 RoR,但到目前为止,我尝试过的许多教程都无法通过设置。好像很多[ 1 2 新软件已过时,或者我在尝试学习代码之前收到错误消息。如果有人知道一个很好的初学者教程,那就太好了。再次感谢!
【问题讨论】:
标签: rvm