Closed srpouyet closed 1 month ago
Having the same issue since the last update. I'm on Ruby 3.3.4 Rails 7.0.8.5
2024-10-23 12:11:25.752 [info] (app) Ruby LSP> Running bundle install for the custom bundle. This may take a while...
Ruby LSP> Command: (bundle _2.3.12_ check || bundle _2.3.12_ install) 1>&2
2024-10-23 12:11:26.337 [info] (app) The Gemfile's dependencies are satisfied
2024-10-23 12:11:27.825 [info] (app) Initializing Ruby LSP v0.20.1...
2024-10-23 12:11:27.831 [info] (app) Using formatter specified by user: rubocop
2024-10-23 12:11:27.831 [info] (app) Auto detected linters: rubocop
2024-10-23 12:11:27.831 [info] (app) Detected test library: rspec
2024-10-23 12:11:27.831 [info] (app) Finished initializing Ruby LSP!
2024-10-23 12:11:28.300 [info] (app) Activating Ruby LSP Rails add-on v0.3.20
2024-10-23 12:11:28.309 [info] (app) Ruby LSP Rails booting server
2024-10-23 12:11:35.083 [info] (app) Finished booting Ruby LSP Rails server
2024-10-23 12:26:29.367 [info] (app) Request failed:
2024-10-23 12:26:29.367 [info] (app) /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/ruby-lsp-rails-0.3.20/lib/ruby_lsp/ruby_lsp_rails/server.rb:149:in `resolve_route_info': undefined method `source_location' for an instance of ActionDispatch::Journey::Route (NoMethodError)
2024-10-23 12:26:29.367 [info] (app)
2024-10-23 12:26:29.367 [info] (app) if route&.source_location
2024-10-23 12:26:29.367 [info] (app) ^^^^^^^^^^^^^^^^^
2024-10-23 12:26:29.367 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/ruby-lsp-rails-0.3.20/lib/ruby_lsp/ruby_lsp_rails/server.rb:117:in `execute'
2024-10-23 12:26:29.367 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/ruby-lsp-rails-0.3.20/lib/ruby_lsp/ruby_lsp_rails/server.rb:100:in `start'
2024-10-23 12:26:29.367 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/ruby-lsp-rails-0.3.20/lib/ruby_lsp/ruby_lsp_rails/server.rb:252:in `<top (required)>'
2024-10-23 12:26:29.367 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.0.8.5/lib/rails/commands/runner/runner_command.rb:43:in `load'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.0.8.5/lib/rails/commands/runner/runner_command.rb:43:in `perform'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.0.8.5/lib/rails/command/base.rb:87:in `perform'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.0.8.5/lib/rails/command.rb:48:in `invoke'
2024-10-23 12:26:29.368 [info] (app) from /Users/breiko83/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.0.8.5/lib/rails/commands.rb:18:in `<top (required)>'
2024-10-23 12:26:29.368 [info] (app) from bin/rails:4:in `require'
2024-10-23 12:26:29.368 [info] (app) from bin/rails:4:in `<main>'
+1 Having the same issue with Ruby 3.0.6 and Rails 6.1
2024-10-23 14:36:44.579 [info] (quipuapp) /usr/lib/fullstaq-ruby/versions/3.0.6-jemalloc/lib/ruby/gems/3.0.0/gems/ruby-lsp-rails-0.3.20/lib/ruby_lsp/ruby_lsp_rails/server.rb:149:in `resolve_route_info': undefined method `source_location' for
#(NoMethodError)
Thank you for the bug report! There's a PR open to fix it #489, just waiting on reviews.
Hi,
First, thanks for
ruby-lsp
andruby-lsp-rails
! It really enhances the ruby VSCode experience ✨When running
ruby-lsp-rails
(version0.3.20
) with a rails 6.1 app, the addon callsActionDispatch::Journey::Route#source_location
. However, it seems like thatsource_location
is not (yet) defined in rails 6.1, which leads to thisNoMethodError
popping up in the extension's output:(Hopefully correctly) verifying that the method is undefined in pry: