列出ruby版本
console:~$ rvm list
rvm rubies
ruby-2.0.0-p481 [ i686 ]
# => - current
# =* - current && default
# * - default
Run Code Online (Sandbox Code Playgroud)
尝试使用特定版本的ruby
console:~$ rvm use 2.0.0
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
Run Code Online (Sandbox Code Playgroud)
Bro*_*tse 221
您的控制台没有作为登录shell运行,因此无法访问rvm函数.如果您正在运行Ubuntu,您可以:
inq*_*ive 104
输入bash --login您的终端.然后给rvm use 2.0.0
akb*_*bin 45
看起来你的rvm没有正确加载".bash_profile".我已经完成了通过打开终端修复它在MAC OS X或Ubuntu 14.04中并写入:
source ~/.rvm/scripts/rvm
Run Code Online (Sandbox Code Playgroud)
小智 36
我的环境是OSX Yosemite.有同样的问题....通过添加以下解决
1)编辑并添加[[-s"$ HOME/.rvm/scripts/rvm"]] &&."$ HOME/.rvm/scripts/rvm" 到.bash_profile文件
2)重新启动终端并再次尝试RVM命令
小智 30
如果您不希望每次打开终端时再次执行上述建议,只需添加即可
source ~/.rvm/scripts/rvm
Run Code Online (Sandbox Code Playgroud)
在......的最后 ~/.bashrc
Sum*_*not 14
该错误是由于rvm未在登录shell中运行.因此,请尝试以下命令:
/bin/bash --login
Run Code Online (Sandbox Code Playgroud)
您可以立即在终端中作为登录shell运行rvm命令.
谢谢!
Vig*_*jis 14
与其他答案相同的原则,只是认为它比重新开放终端更快:)
bash -l -c "rvm use 2.0.0"
Run Code Online (Sandbox Code Playgroud)
小智 12
我认为这个更通用的解决方案
echo 'source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
在 ubuntu 19.1 中为我工作
source ~/.rvm/scripts/rvm
Run Code Online (Sandbox Code Playgroud)
您需要添加source ~/.rvm/scripts/rvm到~/.your_shellrc file.从现在开始加载shell时,将加载rvm.
例如:
如果您使用的是zsh shell,则需要添加~/.zshrc文件
如果您使用的是bash shell,则需要添加~/.bashrc文件
然后打开一个新选项卡以查看效果.
在Ubuntu(18.08)中,对于我来说,我在.bashrc中添加了以下代码,它可以正常工作。
source /home/username/.rvm/scripts/rvm
Run Code Online (Sandbox Code Playgroud)
请添加此行。
| 归档时间: |
|
| 查看次数: |
83438 次 |
| 最近记录: |