-
Notifications
You must be signed in to change notification settings - Fork 40
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
light.run method leads to undefined method `call' for nil:NilClass (NoMethodError) #200
Comments
It results in the same error for the stoplight gem version |
You use Stoplight syntax that is not compatible with your Stoplight version. I suggest you use the latest Stoplight version (4.1). If, for some reason, you cannot use Stoplight 4.1, you need to rewrite your example the following way: - light = Stoplight('http-api')
+ light = Stoplight('http-api') { 22.0 / 7 }
- light.run { 22.0 / 7 }
+ light.run You can find more details in the update guide https://github.com/bolshakov/stoplight/blob/master/UPGRADING.md |
All right, I have confused you with this backward incompatible change.
|
I released v3.0.2, which shows a better error message in such cases. let me know if you have any further questions |
Describe the bug
When I run this small code below:
it leads to the below error:
/Users/thewall/.gem/ruby/3.0.0/gems/stoplight-3.0.1/lib/stoplight/light/runnable.rb:56:in
run_code': undefined method
call' for nil:NilClass (NoMethodError)To Reproduce
Steps to reproduce the behavior.
Expected behavior
I expected the above method to run properly without giving any error.
Screenshots
I added the gem in my gemfile like this:
gem 'stoplight'
I also see it in my gemfile.lock:
stoplight (3.0.1)
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: