danchoi / ri.vim

browse ri documentation from Vim
http://github.com/danchoi/ri.vim
MIT License
114 stars 15 forks source link

error: undefined method `gem` for main:Object #7

Closed stardiviner closed 12 years ago

stardiviner commented 12 years ago

ri_vim.rb:5: undefined methodgem' for main:Object (NoMethodError)`

I'm new on Ruby, I do not know which part I miss, and I have not installed something. In README, ri.vim need rdoc 3.8, but I have not found this version. In my Ubuntu 12.10 package system, it has rdoc1.8 and rdoc1.9, and I searched gems with $ gem search rdoc, have not found rdoc3.8 too, only has version rdoc (3.12).

stardiviner commented 12 years ago

I have executed command # gem install rdoc --version 3.8 but still get this error.

danchoi commented 12 years ago

Are you launching Vim with Ruby 1.8 or Ruby 1.9 active? You can see which one is active by typing :! ruby -v in Vim.

stardiviner commented 12 years ago

I solved this problem, I searched on google how to let vim use ruby 1.9, then I found removing old ruby 1.8 can solve this problem.