standardrb / vscode-standard-ruby

The official VS Code extension for the Standard Ruby linter and code formatter
Other
101 stars 7 forks source link

Error running bundle list --name-only #12

Closed edgenard closed 1 year ago

edgenard commented 1 year ago

I keep getting this error in VSCode

[client] Command `bundle list --name-only` failed with exit code 1
[client] stderr:
Could not find rails-7.0.4.3, pg-1.5.3, puma-3.12.6, sassc-2.4.0, jbuilder-2.11.5, sprockets-rails-3.4.2, bootsnap-1.16.0, vite_rails-3.0.14, byebug-11.1.3, rspec-rails-6.0.2, factory_bot_rails-6.2.0, web-console-4.2.0, listen-3.0.8, spring-2.1.1, spring-watcher-listen-2.0.1, dotenv-rails-2.8.1, standard-1.28.2, capybara-3.39.1, selenium-webdriver-4.9.1, webdrivers-5.2.0, simplecov-0.22.0, foundation-rails-6.6.2.0, autoprefixer-rails-10.4.13.0, table_print-1.5.7, square.rb-28.0.0.20230517, rack-cors-2.0.1, pagy-6.0.4, devise-4.9.2, rqrcode-2.2.0, letter_opener-1.8.1, acts-as-taggable-on-9.0.1, psych-3.3.4, actioncable-7.0.4.3, actionmailbox-7.0.4.3, actionmailer-7.0.4.3, actionpack-7.0.4.3, actiontext-7.0.4.3, actionview-7.0.4.3, activejob-7.0.4.3, activemodel-7.0.4.3, activerecord-7.0.4.3, activestorage-7.0.4.3, activesupport-7.0.4.3, railties-7.0.4.3, sprockets-4.2.0, msgpack-1.7.0, vite_ruby-3.3.2, rspec-core-3.12.2, rspec-expectations-3.12.3, rspec-mocks-3.12.5, rspec-support-3.12.0, factory_bot-6.2.1, bindex-0.8.1, dotenv-2.8.1, language_server-protocol-3.17.0.3, lint_roller-1.0.0, rubocop-1.50.2, standard-custom-1.0.0, standard-performance-1.0.1, addressable-2.8.4, mini_mime-1.1.2, nokogiri-1.15.0-arm64-darwin, rack-2.2.7, rack-test-2.1.0, regexp_parser-2.8.0, xpath-3.2.0, rubyzip-2.3.2, websocket-1.2.9, docile-1.4.0, simplecov-html-0.12.3, simplecov_json_formatter-0.1.4, sass-3.7.4, sprockets-es6-0.9.2, execjs-2.8.1, apimatic_core-0.2.3, apimatic_core_interfaces-0.1.2, apimatic_faraday_client_adapter-0.1.2, bcrypt-3.1.18, orm_adapter-0.5.0, responders-3.1.0, warden-1.2.9, chunky_png-1.4.0, rqrcode_core-1.2.0, launchy-2.5.2, nio4r-2.5.9, websocket-driver-0.7.5, mail-2.8.1, rails-dom-testing-2.0.3, rails-html-sanitizer-1.5.0, globalid-1.1.0, builder-3.2.4, marcel-1.0.2, concurrent-ruby-1.2.2, i18n-1.13.0, minitest-5.18.0, tzinfo-2.0.6, method_source-1.0.0, thor-1.2.2, zeitwerk-2.6.8, dry-cli-1.0.0, rack-proxy-0.7.6, parallel-1.23.0, parser-3.2.2.1, rubocop-ast-1.28.1, ruby-progressbar-1.13.0, rubocop-performance-1.16.0, sass-listen-4.0.0, babel-source-5.8.35, babel-transpiler-0.7.0, certifi-2018.01.18, json-pointer-0.0.1, faraday-2.7.4, faraday-follow_redirects-0.3.0, faraday-gzip-1.0.0, faraday-http-cache-2.5.0, faraday-net_http_persistent-2.1.0, faraday-retry-2.1.0, websocket-extensions-0.1.5, loofah-2.21.3, multipart-post-2.3.0, faraday-net_http-3.0.2, zlib-2.1.1, net-http-persistent-4.0.2, timeout-0.3.2, crass-1.0.6, connection_pool-2.4.0 in locally installed gems

Install missing gems with `bundle install`.

[client] Failed to invoke Bundler in the current workspace. After resolving the issue, run the command `Standard Ruby: Start Language Server`

I've run bundle install several times and still the same thing.

I've tried uninstalling and reinstalling the extension

I'm really not sure what to do. My app runs fine so I think the gems are all installed.

searls commented 1 year ago

Are you opening your project as a folder with a Gemfile in the root directory? When you open the VS Code terminal and run bundle exec standardrb, does it run without changing directories?

edgenard commented 1 year ago

Are you opening your project as a folder with a Gemfile in the root directory? When you open the VS Code terminal and run bundle exec standardrb, does it run without changing directories?

When I run bundle exec standardrb in the VScode terminal it runs fine without changing directories

I open the project with a Gemfile in the root directory with gem "standard" as one of the gems

searls commented 1 year ago

OK. Without more information or the ability to reproduce, I won't likely be able to make headway helping you here. Is it possible the context your VS Code is launching in is different from your terminal? For example, if your terminal shell is running a version manager like rvm but you're opening VS Code by double-clicking an app icon, it's possible that they'll be seeing different Rubies. Are you launching VS Code from a terminal with code .?

edgenard commented 1 year ago

I apologize for disappearing on this. I noticed that this happens when VSCode updates and restarts itself. When I start VSCode from the terminal this error does not happen. I think you're hunch was right, something about starting VSCode through the app launcher is causing it to see a different Ruby.

The fix/workaround is to close VSCode and restart it from the terminal