Install RVM and Ruby 1.9.x - Linux

Install RVM and Ruby 1.9.x - Linux

RVM installation is more straightforward on Linux, as the Ruby source wasdesigned for the GCC compiler that ships with any Linux distribution.

First install curl, so that you can fetch the RVM script.For Ubuntu, runthe following command:

$ sudo apt-get update
$ sudo apt-get install -y curl

For RedHat/CentOS:

$ sudo yum update
$ sudo yum install -y curl

With curl installed, run the RVM install with the following commands:

$ \curl -L https://get.rvm.io | bash -s stable
$ source $HOME/.rvm/scripts/rvm

On Ubuntu, run rvm requirements to install additional dependencies:

$ rvm requirements

For CentOS, rvm requirements will need to download packages from EPEL, soadd the --verify-downloads 1 parameter after the rvm requirements command:

$ rvm requirements --verify-downloads 1

Next build and install Ruby 1.9.3 (this will take awhile):

$ rvm install 1.9.3
$ rvm use 1.9.3
$ rvm rubygems latest

Verify rvm install:

$ rvm -h
$ rvm list
$ rvm use 1.9.3
$ ruby -v
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]

Install Ruby 2.0.0 - Linux

Installing Ruby 2.0 is very straightforward, just run the following:

$ rvm install 2.0.0

Verify the Ruby 2.0 install by running the following commands:

$ rvm use 2.0.0
$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]

If you want to make Ruby 2.0 your default version of ruby, run the following:

$ rvm use 2.0.0 --default

Remove RVM - Linux

Should you want to uninstall/remove RVM, it’s pretty easy. First, runthe following commands:

$ rvm implode
$ gem uninstall rvm

Then just follow the instructions from rvm implode:

  • Delete the following files, if they exist:/etc/rvmrc$HOME/.rvmrc

  • Also, remove the lines sourcing RVM scripts from$HOME/.bash_profile /etc/zprofile and/etc/profile.d/rvm.sh if they exist. (A reboot doesn’t hurtafter you do this, just to make sure).


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值