I'm using rbenv
, and when trying to use the build function inside Sublime Text 2 (Cmd+B
) it tries to use the ruby and gems under /Library/Ruby/Gems/
How can I tell ST2 to use my rbenv rubies?
PS: I installed rbenv using boxen.
I figured out this. In order to configure rbenv in ST2 you need to go to Browse Packages, then select the Ruby package, and edit the file Ruby.sublime-build
changing the cmd
property, like this:
{
"cmd": ["/path/to/your/ruby/shim", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
In my case, since I'm using boxen, the path was /opt/boxen/rbenv/shims/ruby
, but in a standard rbenv installation it should be something like /home/username/.rbenv/shims/ruby
in Linux or /Users/username/.rbenv/shims/ruby
in OS X.