Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.