{"action":"created","issue":{"url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/53","repository_url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop","labels_url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/53/comments","events_url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/53/events","html_url":"https://github.com/SublimeLinter/SublimeLinter-rubocop/issues/53","id":308294153,"number":53,"title":"/usr/bin/ruby: No such file or directory -- bundle (LoadError)","user":{"login":"revolter","id":5748627,"avatar_url":"https://avatars0.githubusercontent.com/u/5748627?v=4","gravatar_id":"","url":"https://api.github.com/users/revolter","html_url":"https://github.com/revolter","followers_url":"https://api.github.com/users/revolter/followers","following_url":"https://api.github.com/users/revolter/following{/other_user}","gists_url":"https://api.github.com/users/revolter/gists{/gist_id}","starred_url":"https://api.github.com/users/revolter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revolter/subscriptions","organizations_url":"https://api.github.com/users/revolter/orgs","repos_url":"https://api.github.com/users/revolter/repos","events_url":"https://api.github.com/users/revolter/events{/privacy}","received_events_url":"https://api.github.com/users/revolter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-24T19:57:49Z","updated_at":"2018-03-25T09:51:39Z","closed_at":null,"author_association":"NONE","body":"Having these Sublime Linter settings:\r\n\r\n```json\r\n// SublimeLinter Settings - User\r\n{\r\n\t\"debug\": true,\r\n\t\"linters\": {\r\n\t\t\"rubocop\": {\r\n\t\t\t\"use_bundle_exec\": true\r\n\t\t}\r\n\t},\r\n\t\"paths\": {\r\n\t\t\"osx\": [\r\n\t\t\t\"~/.gems/bin\"\r\n\t\t]\r\n\t}\r\n}\r\n```\r\n\r\nI still get `/usr/bin/ruby: No such file or directory -- bundle (LoadError)`:\r\n\r\n```\r\nSublimeLinter: #7 SublimeLinter.sublime-package:747: 'rubocop' is linting 'main.rb'\r\nSublimeLinter: #7 SublimeLinter.sublime-package:1045: rubocop: main.rb ['/usr/bin/ruby', '-S', 'bundle', 'exec', 'rubocop', '--format', 'emacs', '--force-exclusion', '--stdin', '/path/to/main.rb']\r\nSublimeLinter: #7 SublimeLinter.sublime-package:1048: rubocop: cwd: /path/to\r\nSublimeLinter: #7 SublimeLinter.sublime-package:774: rubocop output:\r\n    /usr/bin/ruby: No such file or directory -- bundle (LoadError)\r\nSublimeLinter: #7 SublimeLinter.sublime-package:815: rubocop: No match for line: '/usr/bin/ruby: No such file or directory -- bundle (LoadError)'\r\n```\r\n\r\nBundler was installed using the official instructions and is available in the `PATH`:\r\n\r\n```bash\r\n> which rubocop\r\n/Users/revolt/.gems/bin/rubocop\r\n```"},"comment":{"url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/comments/375958138","html_url":"https://github.com/SublimeLinter/SublimeLinter-rubocop/issues/53#issuecomment-375958138","issue_url":"https://api.github.com/repos/SublimeLinter/SublimeLinter-rubocop/issues/53","id":375958138,"user":{"login":"revolter","id":5748627,"avatar_url":"https://avatars0.githubusercontent.com/u/5748627?v=4","gravatar_id":"","url":"https://api.github.com/users/revolter","html_url":"https://github.com/revolter","followers_url":"https://api.github.com/users/revolter/followers","following_url":"https://api.github.com/users/revolter/following{/other_user}","gists_url":"https://api.github.com/users/revolter/gists{/gist_id}","starred_url":"https://api.github.com/users/revolter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revolter/subscriptions","organizations_url":"https://api.github.com/users/revolter/orgs","repos_url":"https://api.github.com/users/revolter/repos","events_url":"https://api.github.com/users/revolter/events{/privacy}","received_events_url":"https://api.github.com/users/revolter/received_events","type":"User","site_admin":false},"created_at":"2018-03-25T09:51:39Z","updated_at":"2018-03-25T09:51:39Z","author_association":"NONE","body":"> Use a linter setting (these settings can be changed per project)\r\n\r\nThe `paths` part I took from the [official docs](http://www.sublimelinter.com/en/stable/troubleshooting.html#adding-to-the-paths-setting), so the instructions should be updated.\r\n\r\nChanging the SublimeLinter preferences to:\r\n\r\n```json\r\n{\r\n\t\"debug\": true,\r\n\t\"linters\": {\r\n\t\t\"rubocop\": {\r\n\t\t\t\"env\": {\r\n\t\t\t\t\"PATH\": \"~/.gems/bin:$PATH\"\r\n\t\t\t},\r\n\t\t\t\"use_bundle_exec\": true\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nthrows this:\r\n\r\n```\r\nSublimeLinter: #4 SublimeLinter.sublime-package:104: PATH:\r\n    /usr/local/bin\r\n    /usr/bin\r\n    /bin\r\n    /usr/sbin\r\n    /sbin\r\n    /opt/X11/bin\r\nSublimeLinter: #4 SublimeLinter.sublime-package:1044: rubocop: main.rb ['/usr/bin/ruby', '-S', 'bundle', 'exec', 'rubocop', '--format', 'emacs', '--force-exclusion', '--stdin', '/path/to/main.rb']\r\nSublimeLinter: #4 SublimeLinter.sublime-package:1047: rubocop: cwd: /path/to\r\nSublimeLinter: #4 SublimeLinter.sublime-package:773: rubocop output:\r\n    /Library/Ruby/Site/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)\r\n    \tfrom /Library/Ruby/Site/2.3.0/rubygems.rb:299:in `activate_bin_path'\r\n    \tfrom /Users/revolt/.gems/bin/bundle:23:in `<main>'\r\nSublimeLinter: #4 SublimeLinter.sublime-package:814: rubocop: No match for line: '/Library/Ruby/Site/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)'\r\nSublimeLinter: #4 SublimeLinter.sublime-package:814: rubocop: No match for line: '\tfrom /Library/Ruby/Site/2.3.0/rubygems.rb:299:in `activate_bin_path''\r\nSublimeLinter: #4 SublimeLinter.sublime-package:814: rubocop: No match for line: '\tfrom /Users/revolt/.gems/bin/bundle:23:in `<main>''\r\n```\r\n\r\n> Maybe stupid but would just rubocop --format emacs --force-exclusion /path/to/main.rb also work given a correct PATH. Say rubocop is globally installed, just like eslint . works if it is globally installed?\r\n\r\n`bundle` is used because I set `use_bundle_exec` to `true`. But disabling it still doesn't work:\r\n\r\n```\r\nSublimeLinter: #1 SublimeLinter.sublime-package:104: PATH:\r\n    /Users/revolt/.gems/bin\r\n    /usr/local/bin\r\n    /usr/bin\r\n    /bin\r\n    /usr/sbin\r\n    /sbin\r\n    /opt/X11/bin\r\nSublimeLinter: #1 SublimeLinter.sublime-package:1044: rubocop: main.rb ['/usr/bin/ruby', '-S', 'rubocop', '--format', 'emacs', '--force-exclusion', '--stdin', '/path/to/main.rb']\r\nSublimeLinter: #1 SublimeLinter.sublime-package:1047: rubocop: cwd: /path/to\r\nSublimeLinter: #1 SublimeLinter.sublime-package:773: rubocop output:\r\n    /usr/bin/ruby: No such file or directory -- rubocop (LoadError)\r\nSublimeLinter: #1 SublimeLinter.sublime-package:814: rubocop: No match for line: '/usr/bin/ruby: No such file or directory -- rubocop (LoadError)'\r\n```\r\n\r\neven though:\r\n\r\n```\r\n> which rubocop\r\n/Users/revolt/.gems/bin/rubocop\r\n```\r\n\r\nAnd as you can see, `SublimeLinter` is printing the `PATH` which actually does contain `/Users/revolt/.gems/bin`.\r\n\r\n(this second reply was tested first, so it was tested with the old `paths` in the preferences; changing it to `env` only causes it to crash with ``find_spec_for_exe': can't find gem rubocop`)"}}
{"actor":{"display_login":"revolter"}}