LoginSignup
25
24

More than 5 years have passed since last update.

OSX Mavericks にhomebrew + rbenvでruby 2.1.1インストール (2014/04/18)

Last updated at Posted at 2014-04-17

(追記:2014/Aug/5)
rbenv install 2.1.1がreadlineでコケる問題、この方法で解決しました。

curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1

rbenv - Error compiling Ruby 2.1.1

==================

Mavericksにアップデートしたら、homebrew環境が壊滅的に壊れました。
rubyを入れなおそうとしたら以下のエラー

$ xxx -> RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.1.1
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /Users/stakei/.rbenv/versions/2.1.1

Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/wt/lwvqd5_j2kj6fcmg2nzgjld00000gn/T/ruby-build.20140418025042.58008
Results logged to /var/folders/wt/lwvqd5_j2kj6fcmg2nzgjld00000gn/T/ruby-build.20140418025042.58008.log

Last 10 log lines:
compiling ossl_x509crl.c
compiling ossl_x509ext.c
compiling ossl_x509name.c
1 warning generated.
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
installing default openssl libraries
linking shared-object openssl.bundle
make: *** [build-ext] Error 2

ハマりまくったのですが、こちらのエントリーで解決。

MacでRuby 2.x.xがインストールできないバグ (homebrew + rbenv)

以下、備忘録として。
homebrewを入れなおし、brew doctorで出たエラーファイルは全て削除(削除しないほうがいいらしいが?)。
パッケージはbrew uninstall xxx -> brew install xxxで再インストール。

# Install homebrew
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ echo export PATH="/usr/local/bin:$PATH" >> ~/.zprofile

# Check homebrew
$ brew doctor

# Install ruby 2.1.1
$ brew update
$ brew install rbenv ruby-build
$ brew uninstall openssl && brew install openssl

# readline 6.3.3 should be uninstalled, and install readline 6.2.4
$ brew uninstall readline
$ cd /usr/local/
$ git checkout 0181c8a Library/Formula/readline.rb
$ brew install readline

$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.1.1

$ rbenv versions

(ヽ´ω`)

25
24
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
25
24