[英]rvm switches to old ruby version after reboot against default set
Every time I startup my computer (Ubuntu 12.04 LTS), it loads ruby 1.8.7, even when ruby 2.1.1 is set as =* - current && default
(upon rvm list
). 每当我启动计算机(Ubuntu 12.04 LTS)时,即使将ruby 2.1.1设置为
=* - current && default
(在rvm list
),它也会加载ruby 1.8.7。
To change the version I use rvm use ruby-2.1.1
要更改我使用
rvm use ruby-2.1.1
的版本, rvm use ruby-2.1.1
However, every single time I use the use
command, I get the popular error message RVM is not a function...
. 但是,每次我使用
use
命令时,都会收到流行的错误消息RVM is not a function...
So, again every single time, I have to follow the same steps, ie first type [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
因此,每一次,我都必须遵循相同的步骤,即首先键入
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
and only then switch to ruby-2.1.1 with rvm use ruby-2.1.1
. [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
,然后使用rvm use ruby-2.1.1
切换到ruby-2.1.1并rvm use ruby-2.1.1
。 Then, also Rails switches automatically from 2-something to 4.1.4. 然后,Rails也会自动从2点切换到4.1.4。
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
do and how do I understand this syntax? [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
以及如何理解此语法? (I can't see any command here, really - just the parameter -s) You can make rvm known to your bash sessions simply by updading your .bashrc : 您可以通过更新.bashrc来使rvm在bash会话中众所周知:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . echo'[[-s“ $ HOME / .rvm / scripts / rvm”]] &&。 "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc.
“ $ HOME / .rvm / scripts / rvm”'>>〜/ .bashrc。
(Info: Your problem was that you invoked the previous scripts and the changes they made lasted only for your current bash session. Now it's executed every time you open bash) (信息:您的问题是您调用了先前的脚本,并且它们所做的更改仅在您当前的bash会话中持续。现在,每次您打开bash都会执行该脚本)
Your problem is that RVM is not loaded when you open a terminal, you have to manually add the source at each instance of the Terminal. 您的问题是打开终端时未加载RVM,您必须在终端的每个实例上手动添加源。
You need to add rvm source to the bashrc or bash_profile to resolve this issue. 您需要将rvm源添加到bashrc或bash_profile中以解决此问题。
Open terminal: 打开终端:
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile 回显“源$ HOME / .rvm / scripts / rvm” >>〜/ .bash_profile
Or this (if using non-login shell): 或这个(如果使用非登录外壳):
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bashrc 回声“源$ HOME / .rvm / scripts / rvm” >>〜/ .bashrc
This will add the path to RVM to load at each Terminal instanciation (close & re-open a terminal after you did this). 这将添加到RVM的路径以在每个终端实例上加载(完成此操作后关闭并重新打开终端)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.