tags:

views:

149

answers:

1

Hi,

I'm trying to set up editing within irb using vim as described in this vimcast: http://vimcasts.org/episodes/running-vim-within-irb/

I did the gem install interactive_editor and it seemed to install the gem to /home/me/.gems/ruby/1.9.1/gem/interactive_editor, and I also edited my .irbrc file and added:

require 'rubygems' require 'interactive_editor'

but when I try to run vi from irb I get this:

NameError: undefined local variable or method `vi’ for main:Object from (irb):1

I am very new to Ruby/gems etc... I don't even know where to begin. Googling this error didn't really help, I only found a few people with the same issue and no answers.

I'm on Ubuntu 10.04, I have Ruby 1.9.1 installed... not sure about the versions for irb or rubygems.

Thanks a lot!

Here's the output from irb and ruby... something's obviously wrong.

aki@drom:~$ ruby -v
ruby 1.9.0 (2008-10-04 revision 19669) [i486-linux]
aki@drom:~$ irb -v
irb 0.9.5(05/04/13)
aki@drom:~$ irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'interactive_editor'
LoadError: no such file to load -- interactive_editor
from (irb):2:in `require'
from (irb):2
from /usr/bin/irb:12:in `<main>'
+1  A: 

I figured it out, my $GEM_HOME variable was not set properly. I had set it to

/home/me/.gems/ruby/1.9.1/gem/

instead of

/home/me/.gems/ruby/1.9.1/

This fixed it.

Thanks for your help!

spacemanaki