さくらのVPSプラン乗り換え計画(8)

Ruby と Git のインストール。
まずは Ruby。

[takatoh@tk2-254-36564 ~]$ sudo yum install ruby
[takatoh@tk2-254-36564 ~]$ ruby --version
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

うわっ、古い!
そういえば、以前にやった時は rvm を使ったんだっけ。じゃ、今回も rvm で。

[takatoh@tk2-254-36564 takatoh]$ sudo -s
[sudo] password for takatoh:
[root@tk2-254-36564 takatoh]# curl -L https://get.rvm.io |bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24062  100 24062    0     0  30050      0 --:--:-- --:--:-- --:--:-- 30050
Downloading https://github.com/rvm/rvm/archive/1.29.1.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.1/1.29.1.tar.gz.asc
gpg: 2017年02月20日 05時02分47秒 JSTにRSA鍵ID BF04FF17で施された署名
gpg: 署名を検査できません: No public key
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found. Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).

GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.1.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.1/1.29.1.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:

    sudo gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

or if it fails:

    command curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -

the key can be compared with:

    https://rvm.io/mpapis.asc
    https://keybase.io/mpapis

NOTE: GPG version 2.1.17 have a bug which cause failures during fetching keys from remote server. Please downgrade or upgrade to newer version (if available) or use the second method described above.

あれ、なんかエラー?

[root@tk2-254-36564 takatoh]# gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
gpg: 鍵D39DC0E3をhkpからサーバーkeys.gnupg.netに要求
gpg: /root/.gnupg/trustdb.gpg: 信用データベースができました
gpg: 鍵D39DC0E3: 公開鍵“Michal Papis (RVM signing) ”を読み込みました
gpg: 絶対的に信用する鍵が見つかりません
gpg:     処理数の合計: 1
gpg:           読込み: 1  (RSA: 1)

ダメかな?とりあえず試してみる。

[root@tk2-254-36564 takatoh]# curl -L https://get.rvm.io |bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24062  100 24062    0     0  14385      0  0:00:01  0:00:01 --:--:-- 10.5M
Downloading https://github.com/rvm/rvm/archive/1.29.1.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.1/1.29.1.tar.gz.asc
gpg: 2017年02月20日 05時02分47秒 JSTにRSA鍵ID BF04FF17で施された署名
gpg: “Michal Papis (RVM signing) ”からの正しい署名
gpg:                 別名“Michal Papis ”
gpg:                 別名“[jpeg image of size 5015]”
gpg: 警告: この鍵は信用できる署名で証明されていません!
gpg:       この署名が所有者のものかどうかの検証手段がありません。
主鍵の指紋: 409B 6B17 96C2 7546 2A17  0311 3804 BB82 D39D C0E3
副鍵の指紋: 62C9 E5F4 DA30 0D94 AC36  166B E206 C29F BF04 FF17
GPG verified '/usr/local/rvm/archives/rvm-1.29.1.tgz'
Creating group 'rvm'

Installing RVM to /usr/local/rvm/
Installation of RVM in /usr/local/rvm/ is almost complete:

  * First you need to add all users that will be using rvm to 'rvm' group,
    and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.

  * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

# takatoh,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: https://rvm.io/help and https://twitter.com/rvm_io

これでどう?

[root@tk2-254-36564 takatoh]# source /etc/profile.d/rvm.sh

今度は大丈夫そう。rmv list known で利用可能なバージョンが見られる。

[root@tk2-254-36564 takatoh]# 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[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.6]
[ruby-]2.3[.3]
[ruby-]2.4[.0]
ruby-head

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

# JRuby
jruby-1.6[.8]
jruby-1.7[.26]
jruby[-9.1.7.0]
jruby-head

# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx[-3.71]
rbx-head

# Opal
opal

# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1[.2.0]
mruby[-head]

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

# 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

2.3 をインストール。

[root@tk2-254-36564 takatoh]# rvm install 2.3
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/x86_64/ruby-2.3.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: libyaml-devel, readline-devel, zlib-devel, libffi-devel, openssl-devel, sqlite-devel.............
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.3.3, this may take a while depending on your cpu(s)...
ruby-2.3.3 - #downloading ruby-2.3.3, 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 13.7M  100 13.7M    0     0  9730k      0  0:00:01  0:00:01 --:--:-- 10.9M
ruby-2.3.3 - #extracting ruby-2.3.3 to /usr/local/rvm/src/ruby-2.3.3....
ruby-2.3.3 - #configuring......................................................-
ruby-2.3.3 - #post-configuration..
ruby-2.3.3 - #compiling........................................................-
ruby-2.3.3 - #installing............................
ruby-2.3.3 - #making binaries executable..
ruby-2.3.3 - #downloading rubygems-2.6.12
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  749k  100  749k    0     0  3501k      0 --:--:-- --:--:-- --:--:-- 7351k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.3 - #extracting rubygems-2.6.12....
ruby-2.3.3 - #removing old rubygems.........
ruby-2.3.3 - #installing rubygems-2.6.12.........................
ruby-2.3.3 - #gemset created /usr/local/rvm/gems/ruby-2.3.3@global
ruby-2.3.3 - #importing gemset /usr/local/rvm/gemsets/global.gems..............|
ruby-2.3.3 - #generating global wrappers........
ruby-2.3.3 - #gemset created /usr/local/rvm/gems/ruby-2.3.3
ruby-2.3.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.3 - #generating default wrappers........
ruby-2.3.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.3 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
[root@tk2-254-36564 takatoh]# ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

おお、なんかうまくいったみたいだ。

さて、ついでに Git もインストール…と思ったら入ってた(古そうだけど)。

[root@tk2-254-36564 takatoh]# git --version
git version 1.7.1

とりあえずここまで。

[追記]

bundler が入っていなかったのでインストール。

[root@tk2-254-36564 takatoh]# gem install bundler
Fetching: bundler-1.14.6.gem (100%)
Successfully installed bundler-1.14.6
Parsing documentation for bundler-1.14.6
Installing ri documentation for bundler-1.14.6
Done installing documentation for bundler after 9 seconds
1 gem installed

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください