Problem with Vim's Ruby plugin Problem with Vim's Ruby plugin ruby ruby

Problem with Vim's Ruby plugin


Note that instead of editing ruby.vim file you can just add

let g:ruby_path = ':C:\ruby192\bin'

in your _vimrc file (or equivalent for your platform). That way you won't need to keep re-editing ruby.vim when you update it.


If you run RVM and want its default ruby, use:

let g:ruby_path = "/Users/allen/.rvm/rubies/default/bin"

If you set your ruby interpreter in your project .rvmrc file, you can create an environment variable in your .rvmrc:

rvm 1.9.2@projectname --createexport RUBY_BIN=`which ruby | sed 's/ruby$//'`

You can use environment variables in your .vimrc:

let g:ruby_path=$RUBY_BIN

(Note you should also set a default $RUBY_BIN in your .bashrc or .zshrc so this works outside of .rvmrc projects.)

If your ~/.rvm/rubies/default/bin path does not yet exist, you need to set your rvm system default of ruby. At your command prompt or terminal application, enter:

rvm use 1.9.2 --default

using whatever ruby version you need.


How did you install Ruby?

Go into irb and enter:

Gem.all_load_paths.uniq

which should return a list of paths to your install gems that Gem knows about also.

That's what is failing in your error message and leads me to suspect you are missing some path or environment info, because it looks like vim isn't able to find your Ruby gems correctly.

Encoding::ConverterNotFoundError is a core library exception, so that part is working, but it looks like the Gem command isn't working.