LoginSignup
6
6

More than 5 years have passed since last update.

rbenv で ruby2.0.0-p0 のインストール

Last updated at Posted at 2013-02-25

Upgrade ruby-build

まずは ruby-build を upgrade する。

% brew unlink ruby-build
% brew upgrade ruby-build
% ruby-build
ruby-build 20130224
usage: ruby-build [-k|--keep] [-v|--verbose] definition prefix
       ruby-build --definitions
% rbenv install -l
...
2.0.0-p0
...

で ruby 2.0.0-p0があることを確認。

Install Ruby 2.0.0-p0

% CONFIGURE_OPTS="--with-opt-dir=/usr/local" rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/ONDA/.rbenv/versions/2.0.0-p0

これでインストールできているので 2.0.0-p0 を有効にする。

% rbenv local 2.0.0-p0
% ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]

インストール完了。

ちなみに以下でも大丈夫。

% RUBY_CONFIGURE_OPTS="--with-readline-dir=/usr/local --with-openssl-dir=/usr/local" rbenv install 2.0.0-p0                                 [ ~] 
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/ONDA/.rbenv/versions/2.0.0-p0
% rbenv local 2.0.0-p0
% ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]

OpenSSL::SSL::SSLError

証明書の問題でエラーがでたら以下のようにして対処すればいいみたい。
homebrew で入れた openssl を使って Ruby をコンパイルすると SSL 利用時に証明書エラーが発生する場合の対応

% brew install curl-ca-bundle
% cp /usr/local/Cellar/curl-ca-bundle/1.87/share/ca-bundle.crt /usr/local/etc/openssl/cert.pem

おわりに

阿鼻らなかった。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6