Question

The problem is that SublimeLinter will sometimes report lines as containing errors, when they actually don't. One example of this is a line like format.html { redirect_to :action => :index }.

Was it helpful?

Solution

This is because SublimeLinter is using the system ruby, instead of the ruby for your gemset. See, the Ruby linter that SublimeLinter uses is extremely simple. It just runs the code through ruby -wc and marks any output in the code. But that's the problem. Sublime Text 2 isn't using the ruby that your Rails app uses.

You can change the SublimeLinter settings to correct this issue by opening the Sublime Text 2 menu, going into Preferences -> Package Settings -> SublimeLinter, and selecting Settings - User. Add this text to the file, save it, and restart Sublime Text 2:

{
    "sublimelinter_executable_map":
    {
        "ruby": "rvm-auto-ruby"
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top