Last Updated: September 09, 2019
·
5.223K
· franklouwers

Make rvm and Sublime Text 2 play nice

If you use Sublime Text 2 (and you should!) and you use rvm (and you should, unless you use rbenv), you've noticed that they don't play nice with each other by default.

If you want to use the ST2 "Build" system (cmd-B) with rvm, please replace ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Ruby/Ruby.sublime-build (or the corresponding file in your Linux or Windows install) with this:

{
  "cmd": [ "/Users/frank/.rvm/bin/rvm-auto-ruby", "$file" ],
  "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
  "selector": "source.ruby"
}

Note: change the /Users/frank to your homedir. For some reason (my version of) Sublime Text 2 won't pass $HOME and won't work with ~ either. Must debug that ...

5 Responses
Add your response

Thanks for the tip. Do you perhaps know how to make ruby-test work with RVM? I get error messages like: Could not find activesupport-3.2.3 in any of the sources (Bundler::GemNotFound). This is because ruby-test runs from a different location and because of rvm, the gem is not available outside the project folder. Any ideas?

over 1 year ago ·

Hallelujah! Finally got this working! Thanks!

over 1 year ago ·

It's work ! :) thx :)

over 1 year ago ·

thanks!

over 1 year ago ·

You can also just run "which rvm-auto-ruby" and it will return the full path to the file. RVM doesn't always install to the home directory!

over 1 year ago ·