Skip to content

Instantly share code, notes, and snippets.

@cb372
Last active December 22, 2015 23:49
Show Gist options
  • Save cb372/6548989 to your computer and use it in GitHub Desktop.
Save cb372/6548989 to your computer and use it in GitHub Desktop.
Installing ruby 2.0.0-p247 on OS X with un-broken readline
  1. Install OpenSSL via homebrew, if you haven't already. Without this, ruby install will fail trying to compile openssl.

    brew install openssl
    
  2. Install readline via homebrew, if you haven't already. This allows irb to support multi-line characters correctly in.

    brew install readline
    
  3. Install rbenv and ruby-build, if you haven't already

    brew install rbenv
    brew install ruby-build
    
  4. Compile Ruby with the homebrew-installed openssl and readline

    CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install 2.0.0-p247
    

    Wait a while...

  5. Set rbenv version to the newly installed 2.0.0-p247

    rbenv global 2.0.0-p247
    
  6. Check it works

    $ irb
    irb(main):001:0> foo = "あいうえお"
    => "あいうえお"
    irb(main):002:0>
    

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment