Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using RVM to manage Ruby installs and Gems, and MacVim to create and edit Ruby files.

I have a key command in my ~/.vimrc mapped to evaluate a loaded Ruby file and print the output. It looks something like this:

map <Leader>r :w! <bar> !ruby %<CR>

Within a zsh shell, the ruby command respects my RVM setting. In MacVim, however, the ruby command loads the default Ruby at /usr/bin/ruby, and it ignores RVM entirely. Is there any way to get MacVim to recognize the Ruby version I set with RVM?

share|improve this question
up vote 2 down vote accepted

You might be interested in the vim plugin I've just started working on. It's called rvm_ruby.vim and gives you ex commands that will reach RVM ruby executables.

You'd use something like :Ruby % to reach the ruby version you were using when you launched MacVim (assuming you did it using mvim in a login shell).

There's also a :Gem ex command that targets RVM's gem command.

share|improve this answer
that does the trick, and is definitely a better solution than mine. thanks very much! – michaelmichael Sep 27 '10 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .