Sublime Forum

How do I run a Ruby Gem via the Sublime Text 2 Build System?

#1

I’ve tried different settings like simply:

{ "cmd": "rubocop '$file_name'" }
I’ve also tried setting the path, etc:

{ "cmd": "rubocop '$file_name'", "path": "~/.rvm/bin", "selector": "source.rb", "working_dir":"$project_path" }
For both I get an error message along the lines of:

[Errno 2] No such file or directory [cmd: rubocop 'configurer.rb'] [dir: /home/rafal/Documents/Projects/configurer] [path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games] [Finished]
and:

[Errno 2] No such file or directory [cmd: rubocop 'configurer.rb'] [dir: /home/rafal/Documents/Projects/configurer] [path: ~/.rvm/bin] [Finished]
respectively. I have followed some of the tutorials I’ve found online as well as some of the answers at StackOverflow but no luck. Any ideas on why this is happening? What is the correct and working way of running a Ruby Gem upon a currently open file? The Gem Rubocop (github.com/bbatsov/rubocop) is definitely installed.

0 Likes