views:

52

answers:

2

Hello,

I'm trying to update irb on my OS X 10.5 macbook:

$ irb -v
irb 0.9.6(09/06/30)

I'm currently learning Ruby and was following the "Why's Poignant Guide to Ruby" and on this page: http://mislav.uniqpath.com/poignant-guide/book/expansion-pak-1.html they mention auto-completion in irb requires version 1.8 of irb.

I'm not sure entirely how to update the shell. I'm using the latest version of ruby through RVM.

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29034) [i386-darwin9.8.0]

Google has returned nothing, I'd appreciate any help, thanks!

A: 

You don't need to upgrade IRB. You do, however, need Ruby compiled with Readline support. On OS X, I have no idea if that's the default configuration or how to go about installing it. You'll probably need to install the readline development libraries and recompile Ruby via RVM.

AboutRuby
Hmmm, probably a bit over my head right now - I'd like to but I guess I'll just have to pass until I'm more knowledgeable later on - the main reason I'm using RVM in the first place is because of it's ease of use with handling "config stuff" for me. Thanks.
Folken
Right, it does that. But there are just a few things you need before you can get a fully functional Ruby up and running. Notably zlib, openssl and readline. I'm sure there are instructions for installing that stuff on OS X. Also... wait until tomorrow when my Macbook Pro gets here and I can probably tell you :P
AboutRuby
+1  A: 

with rvm you can turn on completion: http://rvm.beginrescueend.com/workflow/completion/

this loads the scripts in your ~/.rvm/scripts dir including irbrc.rb which sets up autocompletion for irb.

Jed Schneider
Thanks Jed this has worked - however when I enter irb I still have to manually pass in the arguments 'irb --readline -r irb/completion'But all is well :)
Folken
glad it helped, you should hop on the irc channel and ask about the need to add the cli arguments. it shouldnt be doing that, perhaps a permissions issue?
Jed Schneider