neoclide / coc-solargraph

Solargraph extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Super weird error when initializing

dylanirlbeck opened this issue · comments

Hi all. I'm experiencing a super frustrating error at the moment. Each time I open a Ruby file in a new project I get hit with this error from coc. coc-solargraph was working probably 1-2 days ago, so I'm not sure what changed.

What's weird is running ruby -v gives me 2.6.2, so I'm not sure why I'm getting an error from a Ruby version mismatch.

[coc.nvim] Failed to start Solargraph: Ignoring bcrypt-3.1.13 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.13                                                                   
Ignoring bcrypt_pbkdf-1.0.0 because its extensions are not built.  Try: gem pristine bcrypt_pbkdf --version 1.0.0                                                                                                
Ignoring bindex-0.8.1 because its extensions are not built.  Try: gem pristine bindex --version 0.8.1                                                                                                            
Ignoring binding_of_caller-0.8.0 because its extensions are not built.  Try: gem pristine binding_of_caller --version 0.8.0                                                                                      
Ignoring bootsnap-1.4.6 because its extensions are not built.  Try: gem pristine bootsnap --version 1.4.6                                                                                                        
Ignoring bootsnap-1.3.2 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.2                                                                                                        
Ignoring bson-4.6.0 because its extensions are not built.  Try: gem pristine bson --version 4.6.0                                                                                                                
Ignoring byebug-11.1.3 because its extensions are not built.  Try: gem pristine byebug --version 11.1.3                                                                                                          
Ignoring byebug-11.1.1 because its extensions are not built.  Try: gem pristine byebug --version 11.1.1                                                                                                          
Ignoring charlock_holmes-0.7.6 because its extensions are not built.  Try: gem pristine charlock_holmes --version 0.7.6                                                                                          
Ignoring debug_inspector-0.0.3 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.3                                                                                          
Ignoring bcrypt-3.1.13 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.13                                                                                                          
Ignoring bcrypt_pbkdf-1.0.0 because its extensions are not built.  Try: gem pristine bcrypt_pbkdf --version 1.0.0                                                                                                
Ignoring bindex-0.8.1 because its extensions are not built.  Try: gem pristine bindex --version 0.8.1                                                                                                            
Ignoring binding_of_caller-0.8.0 because its extensions are not built.  Try: gem pristine binding_of_caller --version 0.8.0                                                                                      
Ignoring bootsnap-1.4.6 because its extensions are not built.  Try: gem pristine bootsnap --version 1.4.6                                                                                                        
Ignoring bootsnap-1.3.2 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.2                                                                                                        
Ignoring bson-4.6.0 because its extensions are not built.  Try: gem pristine bson --version 4.6.0                                                                                                                
Ignoring byebug-11.1.3 because its extensions are not built.  Try: gem pristine byebug --version 11.1.3                                                                                                          
Ignoring byebug-11.1.1 because its extensions are not built.  Try: gem pristine byebug --version 11.1.1                                                                                                          
Ignoring charlock_holmes-0.7.6 because its extensions are not built.  Try: gem pristine charlock_holmes --version 0.7.6                                                                                          
Ignoring debug_inspector-0.0.3 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.3                                                                                          
/Users/dylan/.rvm/gems/ruby-2.6.2/gems/bundler-2.0.1/lib/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.3.7, but your Gemfile specified 2.6.2 (Bundler::RubyVersionMismatch)              
        from /Users/dylan/.rvm/gems/ruby-2.6.2/gems/bundler-2.0.1/lib/bundler/definition.rb:470:in `validate_runtime!'                                                                                           
        from /Users/dylan/.rvm/gems/ruby-2.6.2/gems/bundler-2.0.1/lib/bundler.rb:101:in `setup'                                                                                                                  
        from /Users/dylan/.rvm/gems/ruby-2.6.2/gems/bundler-2.0.1/lib/bundler/setup.rb:20:in `<top (required)>'                                                                                                  
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                       
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'     

Any help is much appreciated, thanks.

As a follow-up, after nuking solargraph and bundler, I'm now getting a Failed to install the Solargraph gem error when I restart coc and then get prompted to install the solargraph gem (which I believe I've already done).

EDIT: I finally got it working... I hardcoded the following settings. I'm done for the day 😄

"solargraph.commandPath": "/Users/dylan/.rvm/gems/ruby-2.6.2/wrappers/solargraph",
  "solargraph.useBundler": false,

The reason is simple, extension can't find solargraph in your global gems.