アーカイブ

‘ruby’ カテゴリーのアーカイブ

rvmを使ってrubyをインストール

2013 年 7 月 1 日 コメントはありません

CentOS6.3にrvmを使ってrubyをインストールします。

rvmは(Ruby enVironment Manager)の略で、rubyに必要なライブラリをインストールしたり、1つの環境に複数バージョンのrubyをインストールしたりできるようにするプログラムです。
>rvmのインストール方法はこちら。

インストール可能なプログラムの一覧を表示する

rvm list known

# rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-p327
[ruby-]1.9.3-p362
[ruby-]1.9.3-p374
[ruby-]1.9.3-p385
[ruby-]1.9.3-p392
[ruby-]1.9.3[-p429]
[ruby-]1.9.3-head
[ruby-]2.0.0-rc1
[ruby-]2.0.0-rc2
[ruby-]2.0.0-p0
[ruby-]2.0.0[-p195]
ruby-head

# GoRuby
goruby

# Topaz
topaz

# TheCodeShop - MRI experimental patches
tcs

# jamesgolick - All around gangster
jamesgolick

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

# JRuby
jruby-1.2.0
jruby-1.3.1
jruby-1.4.0
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7.2
jruby-1.6.8
jruby[-1.7.4]
jruby-head

# Rubinius
rbx-1.0.1
rbx-1.1.1
rbx-1.2.3
rbx-1.2.4
rbx[-head]
rbx-2.0.testing
rbx-2.0.0-rc1

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

# Kiji
kiji

# 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

# Opal
opal

# IronRuby
ironruby[-1.1.3]
ironruby-head
#

rubyをインストールする

rvm install <<インストールするrubyのバージョン>>

# rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6.3/x86_64/ruby-1.9.3-p429.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing requirements for centos, might require sudo password.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p429, this may take a while depending on your cpu(s)...
ruby-1.9.3-p429 - #downloading ruby-1.9.3-p429, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9806k  100 9806k    0     0  1422k      0  0:00:06  0:00:06 --:--:-- 1496k
ruby-1.9.3-p429 - #extracting ruby-1.9.3-p429 to /usr/local/rvm/src/ruby-1.9.3-p429
ruby-1.9.3-p429 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p429
ruby-1.9.3-p429 - #configuring.............................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-1.9.3-p429 - #compiling..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-1.9.3-p429 - #installing ............................................................................................................................................................................................................................................
Retrieving rubygems-1.8.25
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  371k  100  371k    0     0   792k      0 --:--:-- --:--:-- --:--:-- 2692k
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.9.3-p429.....................
Installation of rubygems completed successfully.
Saving wrappers to '/usr/local/rvm/wrappers/ruby-1.9.3-p429'........

ruby-1.9.3-p429 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p429 - #importing default gemsets, this may take time.......................
Install of ruby-1.9.3-p429 - #complete 

#

デフォルトで使用するrubyを選択する

rvm use <<使用するrubyのバージョン>>

# rvm use 1.9.3
Using /usr/local/rvm/gems/ruby-1.9.3-p429
# 
# ruby -v
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]
# 

カテゴリー: Linux, ruby, 開発 タグ: ,