pderichs / sublime_rubocop

A Sublime Text RuboCop plugin.
238 stars 41 forks source link

The plugin seems to use rvm even it is not installed ? #32

Closed Pilooz closed 9 years ago

Pilooz commented 9 years ago

Hi Guys, The plugin seems to look for rvm, even if I did not install it. I' using rbenv. Here my SublimeText Plugin config :

{
  "rubocop_command": "/usr/local/bin/rubocop --auto-correct --format simple -D",
  "check_for_rvm": false,
  "rvm_auto_ruby_path":  "", 
  "check_for_rbenv": false,
  "rbenv_path":  "/usr/local/bin/rbenv",
  "mark_issues_in_view": true,
  "show_auto_correct_warning": true,
  "rubocop_config_file": ""
}

The plugin should not check for rvm as far it is set to falsein my config, should it ? Here is the error I get when I am trying to execute rubocop in ST.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rubocop' (>= 0) among 24 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/local/bin/rubocop:22:in `<main>'
[Finished in 0.1s with exit code 1]
[cmd: /usr/local/bin/rubocop --auto-correct --format simple -D /Users/pgl/developpement/service-suivi-perso/objects/right.rb]
[dir: /Users/pgl/developpement/service-suivi-perso]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

Am I doing some thing wrong ?? Any Idea ?

pderichs commented 9 years ago

I don't see how rvm is involved here.

You should not use the parameters --auto-correct --format simple -D within the rubocop_command setting - this will interfere with the parameters added by the plugin which might cause headaches.

If you use rbenv, you can just use "check_for_rbenv": true instead of providing your own command. You can find more information here: https://github.com/pderichs/sublime_rubocop/wiki/Setting-plugin-to-work-with-rbenv-on-OS-X-and-Linux