mmskvw
Last Updated: February 25, 2016
·
1.998K
· aalvarado
Me

Install Ruby 2.0 on OSX with rbenv and macport's readline support ( reverse search on pry works!)

OSX ships with the older libedit library which is what rbenv picks up if not given an explicit --with-readline-dir configuration flag. I was able to find a lot of info of installing with homebrew but none with macports ( except this one: http://d.hatena.ne.jp/CortYuming/20120606/p1 ) which is in japanese :(. Luckily the bash prompt is in english.

Also I didn't want to use libedit and do this: http://hints.macworld.com/article.php?story=20080313113705760 #sadness :(

In short you want to add it like this ( you might want to throw in openssl support from the same place too ) :

$ CONFIGURE_OPTS="--with-openssl-dir=/opt/local --with-readline-dir=/opt/local" rbenv install 2.0.0-p0

Now I can do:

$ pry
[1] pry(main)> foo = 1
=> 1
(reverse-i-search)`foo': foo = 1

Niceness.

Have fun!

Say Thanks
Respond

4 Responses
Add your response

7160
Ccea3a60906efb3568ea6708289a6058

Thanks dude! That did the trick.

over 1 year ago ·
8797
28530dee1dcfc4561c0dd59f880618d4

Works great! Also works for 2.0.0-p195.

over 1 year ago ·
9943
523676142a79033cfcec349c663b1bb3

Great, thank you. I have been using macports for a lot of bins, libs like opnessl etc., but recently installed rbenv, so compilation of ruby failed, but with these flags it works perfectly.

over 1 year ago ·
11456
B132e6176f5115b43f6a0c5446dea0c2

me gusta

over 1 year ago ·
Awesome Job

E20ce6a2 ca1f 11e7 82be 7f617c8310c9
SENIOR DEVELOPER (m/w)
·
Berlin, Köln, Hamburg, München
·
Full Time