pderichs / sublime_rubocop

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

rvm-auto-ruby: No such file or directory on Sublime Text 2 #49

Open soundasleep opened 7 years ago

soundasleep commented 7 years ago

I've installed the Sublime Text 2 Rubocop plugin but it's failing to check any file. When I run "Rubocop: Check current file", I get the following error:

/bin/sh: /Users/jevon/.rvm/bin/rvm-auto-ruby: No such file or directory
[Finished in 0.0s with exit code 127]

Is there a way to configure this plugin with Sublime Text 2 to not use rvm? Or to configure the command that's run?

rebagliatte commented 7 years ago

@soundasleep this linter uses rvm by default. You can override this on your user settings for the RuboCop sublime package.

Since I use rbenv, here's my RuboCop.sublime-settings:

{
  "check_for_rvm": false,
  "check_for_rbenv": true,
  "rbenv_path":  "/usr/local/bin/rbenv" // The path to your rbenv's binary. Run `which rbenv` to get it.
}
abhilashak commented 7 years ago

If anyone wants to know the path of the rubocop settings:

rubocop-settings

I added the above hash as @rebagliatte suggested to User setting file. But that not seems to be working. I am using Sublime Text 3

benkoshy commented 6 years ago

For anyone reading this in the future, this is what worked for me:

  1. I am using RVM.
  2. I installed auto ruby in the global gemset.
  3. I then discovered where the correct file path was by using the following command in the terminal: which rvm-auto-ruby
  4. from there, I navigated to the RuboCop settings page described above by @abhilashak and I added the correct file path in there.

Voila! Headache averted! Hope this helps someone!!

alexanderadam commented 4 years ago

It seems to be related to the mark_issues part in my case (I'm using rbenv):

  File "/path/to/sublime-3/Installed Packages/RuboCop.sublime-package/rubocop_listener.py", line 46, in update_marks
  File "/path/to/sublime-3/Installed Packages/RuboCop.sublime-package/rubocop_listener.py", line 128, in do_in_file_check
  File "/path/to/sublime-3/Installed Packages/RuboCop.sublime-package/rubocop_listener.py", line 121, in mark_issues
  File "/path/to/sublime-3/Installed Packages/RuboCop.sublime-package/rubocop_listener.py", line 114, in run_rubocop
  File "/path/to/sublime-3/Installed Packages/RuboCop.sublime-package/rubocop_runner.py", line 50, in run
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.rvm/bin/rvm-auto-ruby'

and I'm using this configuration:

{
 "mark_issues_in_view": true,
 "check_for_rvm": false,
 "check_for_rbenv": true,
 "show_auto_correct_warning": false,
 "rbenv_path": "~/.rbenv/bin/rbenv",
 "rubocop_config_file": "./.rubocop.yml"
}
Startouf commented 3 years ago

Same error on sublime text 3 here by the way, but rubocop seems to be working with the config from rebagliatte