irb configure options

  • Thread starter James Edward Gray II
  • Start date
J

James Edward Gray II

Where is a good source I can learn irb configuration options from?

I'm currently interested in whether or not I can get the up arrow to
repeat my last line, but I would also like to see what's available.

Thanks.

James Edward Gray II
 
D

Dave Thomas

Where is a good source I can learn irb configuration options from?

I'm currently interested in whether or not I can get the up arrow to
repeat my last line, but I would also like to see what's available.

There's a chapter on irb in the new PickAxe :)


Cheers

Dave
 
J

James Edward Gray II

There's a chapter on irb in the new PickAxe :)

Well, hurry up and get it to me then! <laughs>

Seriously, you have my order and I'm eagerly awaiting my copy. The
original PickAxe is what brought me into Ruby to begin with, so I
expect great things from the new volume. Thanks in advance for what
I'm sure will be a great read. I've yet to be disappointed by any of
your books.

James Edward Gray II
 
J

James Edward Gray II

If you don't mind going insane, take a look at:

http://poignantguide.net/ruby/expansion-pak-1.html

Thanks for the link. I'm trying to get tab completion going on Mac OS
X, from the suggested:

% irb --readline -r irb/completion
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': No such file
to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:218:in `require'
from /usr/local/lib/ruby/1.8/irb/init.rb:218:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:216:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:216:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13

But as you can see, I'm getting errors. Any ideas?

James Edward Gray II
 
B

Brian Schröder

James said:
Thanks for the link. I'm trying to get tab completion going on Mac OS
X, from the suggested:

% irb --readline -r irb/completion
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': No such file
to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:218:in `require'
from /usr/local/lib/ruby/1.8/irb/init.rb:218:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:216:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:216:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13

But as you can see, I'm getting errors. Any ideas?

James Edward Gray II
I don't run Max OS but it seems to me that you are missing the readline
bindings for ruby.

Regards,

Brian
 
J

James Edward Gray II

I don't run Max OS but it seems to me that you are missing the
readline bindings for ruby.

Yeah, that must be it. I can't load that module from Ruby. I
installed 1.8.2pre2 from source. I wonder why it missed it.

James Edward Gray II
 
J

James Edward Gray II

In case, you're still strugglin...

Chris has a few distribution links:
<http://rubyforge.org/pipermail/poignant-stiffs/2004-July/000086.html>

Thanks. This link explains the Mac OS X problem. Unfortunately, it's
a little dated (focusing on OS X.2). I'll fiddle around a bit, now
that I know what I'm looking for though.

If anybody has managed to get readline working with Ruby 1.8.2pre2 on
Mac OS X though, please chime in with the steps...

James Edward Gray II
 
M

Mark Hubbart

Thanks. This link explains the Mac OS X problem. Unfortunately, it's
a little dated (focusing on OS X.2). I'll fiddle around a bit, now
that I know what I'm looking for though.

If anybody has managed to get readline working with Ruby 1.8.2pre2 on
Mac OS X though, please chime in with the steps...

Mac OS X usually has a readline library installed; and if it is
installed, it's not in a standard place; so Ruby's readline support
quietly fails to compile. I know you can download a precompiled
readline.bundle [1], which you can just drop in, or you can download
gnu readline to compile against.

HTH,
Mark


[1] http://cherryville.org/8896/ruby_readline_for_mac.html
 
A

Alexey Verkhovsky

In case, you're still strugglin...

There are still some people who don't have auto-completion in irb
working properly. In my case (latest One-Click Installer on Win2K), if I
type Array::<tab>, I get a list of methods alright. But if I do
Array.<tab>, I get a segfault instead. On Linux at home completion
works like a swiss clock though.

Is there a recipe for this predicament?

Alex
 
J

James Edward Gray II

Mac OS X usually has a readline library installed; and if it is
installed, it's not in a standard place; so Ruby's readline support
quietly fails to compile. I know you can download a precompiled
readline.bundle [1], which you can just drop in, or you can download
gnu readline to compile against.

GNU readline did the trick for me and I now have tab completion is irb.
Thanks much.

James Edward Gray II
 
S

Steve Zich

Thanks. This link explains the Mac OS X problem. Unfortunately, it's
a little dated (focusing on OS X.2). I'll fiddle around a bit, now
that I know what I'm looking for though.

If anybody has managed to get readline working with Ruby 1.8.2pre2 on
Mac OS X though, please chime in with the steps...

James Edward Gray II

I just managed to get it working with Ruby 1.8.1 on OS X 10.3.4, by
following the directions at:

http://richkilmer.blogs.com/ether/2003/10/building_ruby_1.html

The perl hack was key!

My guess is that it will also work with Ruby 1.8.2pre2... but it's just
a guess.

Cheers

Steve
 
C

Charles Mills

This is a little old but it was helpful the first time I installed ruby
on OS X:
http://richkilmer.blogs.com/ether/2003/10/building_ruby_1.html

It has been a while since I compiled and installed readline on my
system - I am using 4.3, looks like 5.0 is available now:
http://directory.fsf.org/GNU/readline.html
Compiling that from source... installing... works fine.

So I am using Ruby 1.8.2pre2 with readline 5.0 all installed under
/usr/local. irb works as expected.
Are you compiling everything from source?
-Charlie
 
D

Dick Davies

* Alexey Verkhovsky said:
There are still some people who don't have auto-completion in irb
working properly. In my case (latest One-Click Installer on Win2K), if I
type Array::<tab>, I get a list of methods alright. But if I do
Array.<tab>, I get a segfault instead. On Linux at home completion
works like a swiss clock though.

Is there an '--enable-readline' configure flag or similar? That would strike
me as a saner option that all the LD* environment variable hackery...

(No, it still doesn't work out of the box on NetBSD. Bitter, me? :) )
 
F

Francis Hwang

James Edward Gray II said:
Where is a good source I can learn irb configuration options from?

I'm currently interested in whether or not I can get the up arrow to
repeat my last line, but I would also like to see what's available.

Thanks.

James Edward Gray II

RubyGarden has a good page on this: http://www.rubygarden.org/ruby?Irb/TipsAndTricks

I just found out about irb tab-completion over the conference weekend .... sweet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,416
Latest member
LionelQ387

Latest Threads

Top