LoginSignup
8
8

More than 5 years have passed since last update.

rbenvでRuby 2.0.0-p0をMac OS Xに入れる

Last updated at Posted at 2013-02-27

結論

shu_0115さんのこちらの記事で必要十分でした。
http://qiita.com/items/05a09296f3633cadac3f

$ brew update
$ brew upgrade ruby-build
$ brew install openssl curl-ca-bundle readline
$ cp /usr/local/Cellar/curl-ca-bundle/1.87/share/ca-bundle.crt /usr/local/etc/openssl/cert.pem #証明書のコピー
$ RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p0 

これだけで良かったんだ。大事なのはbrewのupdateでしたね。

2013/03/10追記:よくよく見たら、irbで日本語入力できなかったので、readlineとopensslの場所を指定するコマンドを追加した

証明書のコピーについては以下を参照してください。
http://qiita.com/items/12457815d5cee3723b97

良かったよかった。これで、Mykytea-rubyの2.0.0での動作確認ができた。swig周りも問題無さそうですね。

以下過去の情報

参考にしたのはこちらの記事。ほとんど同じです。
Ruby 2.0 on Debian with ruby-build, rbenv - 平衡点 -- equilibrium point --

とりあえず、入れてない場合はHomebrewでrbenvとruby-buildを入れておく。

Terminal
$ brew install rbenv
$ brew install ruby-build
$ echo 'eval "$(rbenv init -)"' >> .bash_profile 
$ source ~/.bash_profile
$ rbenv rehash

ruby-buildのdefinitionを追加する。

$ echo 'install_package "ruby-2.0.0-p0" "http://ftp.ruby-lang.org/pub/ruby/ruby-2.0.0-p0.tar.gz" autoconf standard' > /usr/local/share/ruby-build/2.0.0-p0

できた!

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

やってみてから気づいたのが、githubにはすでに2.0.0-p0のdefinitionが出ていたので、homebrewじゃなくてgitでcloneした人は悩まなくても良かったですね……。
https://github.com/sstephenson/ruby-build/blob/master/share/ruby-build/2.0.0-p0

で、これをそのまま使って入れなおしてみます。

さて、高速になったrequireを体験するとするか

追記

gem installができてませんでした。あれれ。。。

$ gem install rpec
ERROR:  Loading command: install (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
8
8
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
8
8