Vim like ruby interpreter?

[local]frisco:mgarriss:~/dev/jts> irb --readline
/home/mgarriss/lib/ruby/1.6/irb/context.rb:64:in initialize': uninitialized constant ReadlineInputMethod at IRB::Context (NameError) from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in initialize' from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in `start’
from /home/mgarriss/bin/irb:13

Any idea anyone?

···

-----Original Message-----
From: Garriss, Michael [mailto:Michael.Garriss@abacus-direct.com]
Sent: Thursday, December 05, 2002 9:42 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Thank you for the quick response but…
How do I build irb with readline? ./configure --with-readline??

-----Original Message-----
From: Gennady F. Bystritsky [mailto:gfb@tonesoft.com]
Sent: Thursday, December 05, 2002 9:23 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Compile irb with readline, create file ~/.inputrc and put
set editing-mode vi
Then set envar INPUTRC=~/.inputrc
Enjoy “irb --readline”

----- Original Message -----
From: “Garriss, Michael” Michael.Garriss@abacus-direct.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org; vim@vim.org
Sent: Thursday, December 05, 2002 7:50 AM
Subject: Vim like ruby interpreter?

being a vimmer and a newbie to ruby I have come across the need for the
following. I ‘irb’ like creation with vim editing (maybe like bash’s
set -o
vi). Hints? Leads? Links?

TIA


/| |

Michael Garriss |
Software Engineer |
Contractor |
mgarriss@softhome.net |
_|
/
/

That’s exactly what I am having on Solaris right now (no problems on Linux).
Actually, I got it working eventually, however irb requires a shared library
libreadline.so.4. When you setup correct LD_LIBRARY_PATH everything works
fine. But I do not like it. So I try to figure out how to make extention
module Readline to compile with static libreadline.a instead of dynamic.

I’ll share results when I am done (hope soon).
Gennady.

···

----- Original Message -----
From: “Garriss, Michael” Michael.Garriss@abacus-direct.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Thursday, December 05, 2002 9:05 AM
Subject: Re: Vim like ruby interpreter?

[local]frisco:mgarriss:~/dev/jts> irb --readline
/home/mgarriss/lib/ruby/1.6/irb/context.rb:64:in initialize': uninitialized constant ReadlineInputMethod at IRB::Context (NameError) from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in initialize' from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in `start’
from /home/mgarriss/bin/irb:13

Any idea anyone?

-----Original Message-----
From: Garriss, Michael [mailto:Michael.Garriss@abacus-direct.com]
Sent: Thursday, December 05, 2002 9:42 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Thank you for the quick response but…
How do I build irb with readline? ./configure --with-readline??

-----Original Message-----
From: Gennady F. Bystritsky [mailto:gfb@tonesoft.com]
Sent: Thursday, December 05, 2002 9:23 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Compile irb with readline, create file ~/.inputrc and put
set editing-mode vi
Then set envar INPUTRC=~/.inputrc
Enjoy “irb --readline”

----- Original Message -----
From: “Garriss, Michael” Michael.Garriss@abacus-direct.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org; vim@vim.org
Sent: Thursday, December 05, 2002 7:50 AM
Subject: Vim like ruby interpreter?

being a vimmer and a newbie to ruby I have come across the need for the
following. I ‘irb’ like creation with vim editing (maybe like bash’s
set -o
vi). Hints? Leads? Links?

TIA


/| |

Michael Garriss |
Software Engineer |
Contractor |
mgarriss@softhome.net |
_|
/
/

I got it finally.

  • If you have readline installed on your computer and compile ruby, it will
    create module readline.so. And it works fine if you have /usr/local/lib in
    your LD_LIBRARY_PATH.

  • If you do not want to mess with shared libreadline.so you can compile it
    into ext/readline.so. The easiest way to do it is to remove
    /usr/local/lib/libreadline.so.* – this will leave only libreadline.a in
    /usr/local/lib. Recompile ruby again (or just ext/readline) and install it.
    As an alternate approach, you can also edit ext/readline/Makefile after you
    run configure and replace “-lreadline” with “/usr/local/lib/libreadline.a”.

Gennady.

···

----- Original Message -----
From: “Garriss, Michael” Michael.Garriss@abacus-direct.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Thursday, December 05, 2002 9:05 AM
Subject: Re: Vim like ruby interpreter?

[local]frisco:mgarriss:~/dev/jts> irb --readline
/home/mgarriss/lib/ruby/1.6/irb/context.rb:64:in initialize': uninitialized constant ReadlineInputMethod at IRB::Context (NameError) from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:90:in initialize' from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in new’
from /home/mgarriss/lib/ruby/1.6/irb.rb:57:in `start’
from /home/mgarriss/bin/irb:13

Any idea anyone?

-----Original Message-----
From: Garriss, Michael [mailto:Michael.Garriss@abacus-direct.com]
Sent: Thursday, December 05, 2002 9:42 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Thank you for the quick response but…
How do I build irb with readline? ./configure --with-readline??

-----Original Message-----
From: Gennady F. Bystritsky [mailto:gfb@tonesoft.com]
Sent: Thursday, December 05, 2002 9:23 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Vim like ruby interpreter?

Compile irb with readline, create file ~/.inputrc and put
set editing-mode vi
Then set envar INPUTRC=~/.inputrc
Enjoy “irb --readline”

----- Original Message -----
From: “Garriss, Michael” Michael.Garriss@abacus-direct.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org; vim@vim.org
Sent: Thursday, December 05, 2002 7:50 AM
Subject: Vim like ruby interpreter?

being a vimmer and a newbie to ruby I have come across the need for the
following. I ‘irb’ like creation with vim editing (maybe like bash’s
set -o
vi). Hints? Leads? Links?

TIA


/| |

Michael Garriss |
Software Engineer |
Contractor |
mgarriss@softhome.net |
_|
/
/