Environment: Mac OSX 10.8.3; Ruby 1.9.3-p392 via rbenv; ST2 version 2.0.1 build 2217;

I have installed the Ruby Markers plugin for ST2 and the gem rcodetools (which the plugin requires)

However when running the plugin (either from the menu or the hotkey) in a ruby file I get an ST2 error

There was an OS error: No suce file or directory

I've searched for this and most people have said its due to ruby not being in the ST2 $PATH, but as far as I'm aware this isn't the case and the normal Ruby build command works fine.

Has anyone come across this issue before, and/or have a solution. I'd love to get this plugin working.


Answering it myself as I've figured it out and someone may find this question.

rbenv installs the gem executable for xmpfilter (the part of the rcodetools gem used for Ruby Markers) in its shims directory and ST2/Ruby Markers needs to be told where it is.

First in the terminal confirm where xmpfilter is with

$ which xmpfilter

It should be something like /Users/name/.rbenv/shims/xmpfilter

Then in ST2 go to the Preferences-Package Settings-Ruby Markers-User-Settings and paste the following in using the path found in the previous step

    "xmpfilter_bin_posix": "/path/to/xmpfilter"
|improve this answer|||||
  • I don't have it in my sublime text 3. Preferences-Package Settings-Ruby Markers-User-Settings is not there.. – Mohit Jain Jul 9 '14 at 20:05
  • Also I am using RVM. – Mohit Jain Jul 9 '14 at 20:15

As your research showed you, this is an error because the ST2 $PATH variable does not contain the ruby path (actually the xmpfilter path to be specific). This is because ST2 does not load in a user session by default, and since you're using rbenv your ruby environment is appended to the $PATH in your shell configuration file (i.e. .bashrc).

The default settings for the plugin assume you have a multi-user ruby installation and not a single-user installation. There are special settings for both rvm and rbenv managed ruby installations for Ruby Markers. Use "check_for_rvm": true or "check_for_rbenv": true to use xmpfilter with your managed ruby installation.

|improve this answer|||||
  • Yeah I saw those options in the Ruby Markers config, but setting the rbenv one to true had no effect. It was only when I passed in the full path to the bin_posix setting that stuff started working. – fullybaked Apr 8 '13 at 9:09
  • 1
    @fullybaked I just saw your response. If that is the case, then I will have to look into the rbenv handling. I use rvm and know that it works, but I have not tested it with rbenv. – Michael Mims Apr 30 '13 at 13:44
  • oops sorry, didn't even notice you were the plugin author. Yeah, its as I said. The check_for_rbenv has no effect, only setting the xmp_filter param got it working. In fact rbenv can stay set as false of the xmpfilter posix is set. If I can help fix/debug let me know – fullybaked Apr 30 '13 at 13:49

I had several problems with rbenv which I'll summarise below for others:

  1. Make sure rbenv detection is on: "check_for_rbenv": true
  2. Make you've installed rcodetools and run rbenv rehash
  3. If you've installed rbenv using homebrew, the current version of the plugin fails to detect this (it's expect rbenv at ~/.rbenv/bin/rbenv as per the rbenv git installation method
  4. The plugin doesn't respect the rbenv .ruby-version convention since it doesn't change directory when executing the xmpfilter process. I have a fork and pull request open which fixes this

Blog post

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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