安装 Ruby的三种方法

1. 下载ruby源代码,编译,安装

2. 使用发行版自带的安装包,安装

3. 使用 rvm安装。

这种方法如下:

3.1

curl -L https://get.rvm.io | bash -s stable
这一步主要是准备 rvm 环境,并且下载 ruby最新版本。

安装目录是 $HOME/.rvm

3.2 

source ~/.rvm/scripts/rvm
rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin , Michal Papis  [https://rvm.io/]

$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p643]
[ruby-]2.1.4
[ruby-]2.1[.5]
[ruby-]2.2[.1]
[ruby-]2.2-head
ruby-head

# for forks use: rvm install ruby-head- --url https://github.com/github/ruby.git --branch 2.1

# JRuby
jruby-1.6.8
jruby[-1.7.19]
jruby-head
jruby-9.0.0.0.pre1

# Rubinius
rbx-1.4.3
rbx-2.4.1
rbx[-2.5.2]
rbx-head

# Opal
opal

# Minimalistic ruby implementation - ISO 30170:2012
mruby[-head]

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

# GoRuby
goruby

# Topaz
topaz

# MagLev
maglev[-head]
maglev-1.0.0

# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head

# IronRuby
ironruby[-1.1.3]
ironruby-head

$ rvm list

rvm rubies

=* ruby-2.2.1 [ i686 ]

# => - current
# =* - current && default
#  * - default

安装 rails:

gem install rails


安装一个版本的方法:

rvm install ruby-]1.9.1

卸载  rvm:

rvm implode



你可能感兴趣的:(Programming,Language)