Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Sometimes RuboCop is unable to load jaro_winkler #470

Closed
wingrunr21 opened this issue Apr 14, 2019 · 2 comments
Closed

Sometimes RuboCop is unable to load jaro_winkler #470

wingrunr21 opened this issue Apr 14, 2019 · 2 comments
Assignees
Labels
bug Bug reports

Comments

@wingrunr21
Copy link
Collaborator

Originally detailed in #451

It appears that in some circumstances jaro_winkler's native extensions are not being detected properly and so cannot be loaded by the RuboCop spawn

Debugger listening on ws://127.0.0.1:6009/150f4a70-2974-4c7e-8591-db1d1be62a0e
For help, see: https://nodejs.org/en/docs/inspector
[Info  - 8:07:25 PM] Initializing Ruby language server...
[Info  - 8:07:25 PM] Rebuilding tree-sitter for local Electron version
[Info  - 8:07:25 PM] Rebuild succeeded!
Changed file
Lint: executing rubocop -s /Users/peter/XXXXXX/test/models/xxxxxx.rb -f json -R...
Lint: Received invalid JSON from rubocop:

Ignoring jaro_winkler-1.5.2 because its extensions are not built.  Try: gem pristine jaro_winkler --version 1.5.2
Ignoring jaro_winkler-1.5.1 because its extensions are not built.  Try: gem pristine jaro_winkler --version 1.5.1
<more lines with more gems here>

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- jaro_winkler (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/gems/rubocop-0.65.0/lib/rubocop/string_util.rb:3:in `<top (required)>'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/gems/rubocop-0.65.0/lib/rubocop.rb:21:in `require_relative'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/gems/rubocop-0.65.0/lib/rubocop.rb:21:in `<top (required)>'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/gems/rubocop-0.65.0/exe/rubocop:6:in `<top (required)>'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/bin/rubocop:26:in `load'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/bin/rubocop:26:in `<main>'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/bin/ruby_executable_hooks:24:in `eval'
	from /Users/peter/.rvm/gems/ruby-2.5.3@ptcshell/bin/ruby_executable_hooks:24:in `<main>'
@wingrunr21
Copy link
Collaborator Author

This appears to be due to a bug in the environment detection. For some reason gem is being executed under the correct version of Ruby but the actual version of Ruby running is whatever is default on the system. Also seems to be happening independently of version manager or bundler version.

@wingrunr21
Copy link
Collaborator Author

Resolved via b5584d9

spawn-rx was attempting to crawl PATH and find the command to run. I believe this caused oddities with native extensions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug reports
Projects
None yet
Development

No branches or pull requests

1 participant