Ruby
rbenv
brew

Error Shooting for rbenv and readline "Libraty not loaded"

More than 3 years have passed since last update.

Things

Env

  • Mac 10.7
  • rbenv -v rbenv 0.4.0
    • rbenv install 1.9.3-p545
  • brew -v Homebrew 0.9.5

Steps

After ruby install,

RUBY_CONFIGURE_OPTS="--enable-shared --with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl) --with-libyaml-dir=$(brew --prefix libyaml)" rbenv install 1.9.3-p545 -v

Library not loaded. :(

/Users/hogehoge/.rbenv/versions/1.9.3-p545/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/hogehoge/.rbenv/versions/1.9.3-p545/lib/ruby/1.9.1/x86_64-darwin11.4.2/readline.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/readline/lib/libreadline.6.2.dylib (LoadError)
  Referenced from: /Users/hoisjp/.rbenv/versions/1.9.3-p545/lib/ruby/1.9.1/x86_64-darwin11.4.2/readline.bundle
  Reason: image not found - /Users/hoisjp/.rbenv/versions/1.9.3-p545/lib/ruby/1.9.1/x86_64-darwin11.4.2/readline.bundle

Solution

  • 1. reinstall readline
$ brew list readline
/usr/local/Cellar/readline/6.2.4/include/readline/ (8 files)
/usr/local/Cellar/readline/6.2.4/lib/libhistory.6.2.dylib
/usr/local/Cellar/readline/6.2.4/lib/libreadline.6.2.dylib
/usr/local/Cellar/readline/6.2.4/lib/ (6 other files)
/usr/local/Cellar/readline/6.2.4/share/man/ (2 files)
/usr/local/Cellar/readline/6.2.4/share/readline/ (11 files)

$ brew uninstall readline
$ brew install readline
  • 2. brew link (maybe no need.)
$ brew link --force readline
  • 3. Resolved. :)