Last Updated: February 25, 2016
·
4.115K
· al3xnull

Ruby 1.9 Syntax Linting with Sublime Text 2

Recently, I've been diving more into Ruby 1.9 hash syntax and SublimeLinter was driving me nuts. Just all kinds of "errors" which were preventing me from seeing something that was actually wrong as well as not being able to really read my code.

I found quite a few solutions, but changing the ruby executable map in User Preferences didn't really do anything for me. Instead, I chose the following for getting it to work with RVM.

One - mileage may vary on location:

subl ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/SublimeLinter/sublimelinter/modules/ruby.py

Two - Change the executable location to the rvm-auto-ruby:

'executable': '~/.rvm/bin/rvm-auto-ruby',

Once this has been done, restart Sublime and you should be on your way.

3 Responses
Add your response

Side note: This is a very crude method to implement this -- Just a couple weeks ago, my configuration file reverted back (I'm assuming to an update or the like).

over 1 year ago ·

greate tut. but how to do this in ubuntu 12.10. My ruby systax gone when i removed ruby and eventhought i reinstall ruby yesterday

over 1 year ago ·

I believe the best way would be, to change it the user preferences of the SublimeLinter Package. You can find it under Preferences > Package Settings > SublimeLinter > Seettings - User

There you it can look like this one (example using rbenv):

{
  "sublimelinter_executable_map":
  {
    "ruby": "~/.rbenv/shims/ruby"
  }
}
over 1 year ago ·