castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

Getting Bundler::GemNotFound: Could not find rake-12.3.3 in any of the sources in one workspace #159

Open tdegrunt opened 4 years ago

tdegrunt commented 4 years ago

Getting the following error in the "Ruby Language Server" Output in VSCode. This is only with one specific project, but can't seem to find out why.

Error - 12:27:04 PM] Starting client failed
Bundler::GemNotFound: Could not find rake-12.3.3 in any of the sources
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize'

This happens with Solargraph gem 0.38.0

The following is my systemwide vscode setup.

  "solargraph.useBundler": true,

I have no project or workspace settings which override this in any way.

This is in my Gemfile:

  gem 'solargraph'
  gem 'rake', '12.3.3'

I'm using rbenv, but it seems VSCode picks the system ruby?

Starting solargraph from within the Terminal in vscode works:

> bundle exec solargraph socket 
Solargraph is listening PORT=7658 PID=26916

This is what I see in the developer console:

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2720 Failed to start Solargraph: Bundler::GemNotFound: Could not find rake-12.3.3 in any of the sources   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `map!'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:170:in `specs'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:237:in `specs_for'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:226:in `requested_specs'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:108:in `block in definition_method'   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ru...
onDidNotificationChange @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2720
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:259 [Extension Host] rejected promise not handled within 1 second: Bundler::GemNotFound: Could not find rake-12.3.3 in any of the sources  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `map!'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:170:in `specs'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:237:in `specs_for'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:226:in `requested_specs'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:108:in `block in definition_method'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:20:in `setup'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler.rb:107:in `setup'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:259
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1597   ERR Bundler::GemNotFound: Could not find rake-12.3.3 in any of the sources
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `map!'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:170:in `specs'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:237:in `specs_for'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:226:in `requested_specs'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:108:in `block in definition_method'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:20:in `setup'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler.rb:107:in `setup'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
tdegrunt commented 4 years ago

Additionally, my Gemfile.lock has: rake (= 12.3.3)

andrcuns commented 4 years ago

I seem to have the same issue after upgrade from High Sierra to Catalina. What helps me which is not great, but not terrible, is starting solargraph through bundler and setting full path to bundler so it doesn't pick up the system version.