SublimeLinter / SublimeLinter-rubocop

SublimeLinter 3 plugin for Ruby, using rubocop.
MIT License
159 stars 40 forks source link

Not getting any lint errors #5

Closed Siyfion closed 10 years ago

Siyfion commented 10 years ago

Here's the SublimeLinter debug output:

SublimeLinter: rubocop: barcode_renderer.rb ['/Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop', '--format', 'emacs'] 
SublimeLinter: rubocop output:
/Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'rubocop' (>= 0) among 13 total gem(s) (Gem::LoadError)
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop:22:in `<main>'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>' 
SublimeLinter: rubocop: label_sheet_printer.rb ['/Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop', '--format', 'emacs'] 
SublimeLinter: rubocop output:
/Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'rubocop' (>= 0) among 13 total gem(s) (Gem::LoadError)
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop:22:in `<main>'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>' 
SublimeLinter: rubocop: print_list_renderer.rb ['/Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop', '--format', 'emacs'] 
SublimeLinter: rubocop output:
/Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'rubocop' (>= 0) among 13 total gem(s) (Gem::LoadError)
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /Users/siyfion/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop:22:in `<main>'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/siyfion/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>' 

The output of my which commands, followed by my SublimeLinter.sublime-settings file contents.

Simons-MacBook-Pro:LabelLogicLive_PDF siyfion$ which ruby
/Users/siyfion/.rvm/rubies/ruby-2.1.1/bin/ruby
Simons-MacBook-Pro:LabelLogicLive_PDF siyfion$ which rubocop
/Users/siyfion/.rvm/gems/ruby-2.1.1/bin/rubocop
{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "linters": {
            "coffeelint": {
                "@disable": false,
                "args": [],
                "excludes": []
            },
            "rubocop": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "paths": {
            "linux": [],
            "osx": [
                "/usr/local/bin",
                "/Users/siyfion/.rvm/gems/ruby-2.1.1/bin"
            ],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

And my gem list:

Simons-MacBook-Pro:~ siyfion$ gem list

*** LOCAL GEMS ***

actionmailer (4.1.0)
actionpack (4.1.0)
actionview (4.1.0)
activemodel (4.1.0)
activerecord (4.1.0)
activesupport (4.1.0)
arel (5.0.1.20140414130214)
ast (2.0.0)
aws-sdk (1.39.0)
barby (0.5.1)
bigdecimal (1.2.5, 1.2.4)
bson (2.2.2, 1.10.0)
bson_ext (1.10.0)
builder (3.2.2)
bundler (1.6.2)
bundler-unload (1.0.2)
chunky_png (1.3.1, 1.3.0)
coffee-rails (4.0.1)
coffee-script (2.2.0)
coffee-script-source (1.7.0)
colored (1.2)
compass (0.12.6)
configure-s3-website (1.5.5, 1.5.4)
deep_merge (1.0.1, 1.0.0)
erubis (2.7.0)
execjs (2.0.2)
executable-hooks (1.3.1)
filey-diff (1.4.3)
fssm (0.2.10)
gem-wrappers (1.2.4)
hike (2.1.3, 1.2.3)
httparty (0.13.1)
i18n (0.6.9)
io-console (0.4.2)
jbuilder (2.0.6)
jquery-rails (3.1.0)
json (1.8.1)
json_pure (1.8.1)
mail (2.5.4)
mime-types (2.2, 1.25.1)
mini_portile (0.6.0, 0.5.3)
minitest (5.3.3, 4.7.5)
mongo (1.10.0)
multi_json (1.9.3)
multi_xml (0.5.5)
nokogiri (1.6.2.rc2)
parser (2.1.9)
pdf-core (0.2.5)
polyglot (0.3.4)
powerpack (0.0.9)
prawn (1.0.0)
psych (2.0.5, 2.0.3)
rack (1.5.2)
rack-test (0.6.2)
rails (4.1.0)
railties (4.1.0)
rainbow (2.0.0)
rake (10.3.1, 10.1.0)
rdoc (4.1.1, 4.1.0)
rubocop (0.21.0)
ruby-progressbar (1.4.2)
rubygems-bundler (1.4.3)
rvm (1.11.3.9)
s3_website (1.7.4, 1.7.3)
sass (3.3.6, 3.2.19)
sass-rails (4.0.3)
sdoc (0.4.0)
simple-cloudfront-invalidator (1.0.1)
slop (3.5.0)
spring (1.1.2)
sprockets (2.12.1, 2.11.0)
sprockets-rails (2.1.3)
sqlite3 (1.3.9)
test-unit (2.5.5, 2.1.1.0)
thor (0.19.1, 0.18.1)
thread_safe (0.3.3)
tilt (2.0.1, 1.4.1)
treetop (1.5.3, 1.4.15)
ttfunk (1.1.1)
turbolinks (2.2.2)
tzinfo (1.1.0)
uglifier (2.5.0)
uuidtools (2.1.4)
zopfli (0.0.3)
aparajita commented 10 years ago

I recommend posting on the google group. I'm looking for someone to take responsibility for this linter, I don't use ruby so there is no chance of me spending any time maintaining it.

aparajita commented 10 years ago

rvm depends on messing with the shell to work, and thus only works correctly from the shell. I recommend using rbenv, which works well with SublimeLinter.

xiaohui-zhangxh commented 9 years ago

I got the same issue but it's been fixed, try to install rubocop into global gemset of RVM

rvm ruby-2.0.0-p481@global do gem i rubocop

suffix @global is key to resolve.

fyuw commented 8 years ago

@xiaohui-zhangxh that rules ;)

for me just : rvm install ruby-2.0.0-p481