On Sep 17, 2006, at 11:31 AM, Josef Wolf wrote:

> Actually, readline _is_ available.  It just don't support line- 
> editing and
> history:
>
>    $ ruby -rreadline -e 'p readline'
>    asdfsfs^[[D^[[D
>    "asdfsfs\e[D\e[D\n"
>    $
>
> So what might be the reason that history/editing is not supported?   
> Are
> there different libraries?  "ri readline" says:


$ ri Kernel#readline
-------------------------------------------------------- Kernel#readline
      readline(separator=$/)   => string
------------------------------------------------------------------------
      Equivalent to Kernel::gets, except readline raises EOFError at end
      of file.

Not what you want. You want Readline#readline.

$ ruby -rreadline -e 'Readline.readline'
...

See Joel VanderWerf's post for a complete example (he includes  
Readline into his class).

-- Daniel