-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grape 2.1.x fail to compile, NoMethodError: undefined method []' for nil in grape/dsl/inside_route.rb:421:in
route'
#2491
Comments
This is similar to #1956 I believe, what version of Rack do you have? Can you put up a repro where this happens please? I've upgraded grape to 2.x in ruby-grape/grape-on-rails#65 and it worked ok. |
@dblock I have rack 3.1.7 on Rails 7.2. Something weird is here. Error exists in rails console but api works well on rails server. grape-swagger-rails produce valid swagger. This is my Gemfil.lock
|
@dblock I've checked your ruby-grape/grape-on-rails#65 and the problem exists in console. In code grape/lib/grape/dsl/inside_route.rb Line 423 in dfc0e16
env is nil |
#2444 introduced the bug. |
@DonMat the error occurs only when compiling in console ? When compiling in console, it calls |
Looks like we now understand why it happens. Can either of you help with an integration test that is a big higher level than the fix in #2492? I'd like a test that reproduces "it doesn't work in console" in https://github.com/ruby-grape/grape-swagger-rails and here, so we can catch similar regressions easier. |
@DonMat test w/HEAD please? |
@dblock It work like a charm. Thank you for very fast fix.
|
I've an issue after upgrade Grape from 2.0 to 2.1.x
My apps setup. The same error is produced on:
Ruby 3.3.4, Rails 7.2
Ruby 3.3.1 , Rails 7.0.8.4, 7.1.3.3
Official repo Grape on Rails behaves the same after upgrade Grape locally to 2.1.3
Steps to reproduce:
Twitter::API.compile!
with Grape 2.0Twitter::API.compile!
The text was updated successfully, but these errors were encountered: