安装 RVM(Ruby 版本管理器) [英] Installing RVM (Ruby Version Manager)

查看:44
本文介绍了安装 RVM(Ruby 版本管理器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以将其转化为我需要采取的可管理步骤吗:

Can someone please translate this into manageable steps I need to take:

~ Wayne

You must now finish the install manually:
1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:
     [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
   Please note that this must only occur once - so, you only need to add it the first time you install rvm.
2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly).
   This means that if you see '[ -z  ] && return' then you must change this line to:
   if [[ ! -z  ]] ; then
     ... original content that was below the && return line ...
   fi # <= be sure to close the if.
   #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 items in the .bashrc, including the 'source' line above
3) Then CLOSE THIS SHELL and open a new one in order to use rvm.
[ -z "$PS1" ] && return


WARNING:  you have a 'return' statement in your .bashrc, likely this will cause untold havoc.
   This means that if you see '[ -z $PS1 ] && return' then you must change this line to:
   if [[ -n $PS1 ]] ; then
     ... original content that was below the && return line ...
   fi # <= be sure to close the if.
   #EOF .bashrc
Even if you use zsh you should still adjust the .bashrc as above.
If you have any questions about this please visit #rvm on irc.freenode.net.

Installation of RVM to /home/kapplej/.rvm/ is complete.

我是一个完全的新手,所以我什至不确定哪个是 shell 的加载文件,我该如何编辑它?

I'm a complete newbie, so I am not even sure which one is shell's loading file, and how do I edit it?

推荐答案

我找到了怎么做,希望这能节省一些时间:

I found out how to do this, hope this saves someone time:

要安装 RVM,请在终端中输入以下内容:

to install RVM, enter the following in your terminal:

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

安装 rvm 后,

根据您使用的文本编辑器,我使用的是mate,所以我输入了:

depending on which text editor you are using, I am using mate, so I typed in:

mate .bashrc

然后一旦你的文本编辑器窗口打开,复制并粘贴这一行到其中:

then once your text editor window opens up, copy and paste this line into it:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

现在保存并关闭该窗口.

now save and close that window.

然后重复:

mate .bash_profile

关闭该终端并重新启动一个新终端

close that terminal and restart a new terminal

输入:

rvm use 1.9.1 (or 1.9.2)

然后输入:

ruby -v

你应该看到 ruby​​1.9.1

and you should see ruby1.9.1

要恢复默认设置,请键入:

to get back to default, type:

rvm default

现在您应该获得 ruby​​ 1.8.6(或 1.8.7,具体取决于您的默认值).

now you should get ruby 1.8.6 (or 1.8.7 depending on your default).

这篇关于安装 RVM(Ruby 版本管理器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆