Ever wondered what HTTP requests the Ruby gem you are using to connect to a third party API is making? Use HTTP Spy to see what is going on behind the scenes
If you include the gem in a project and attempt to make an HTTP request without first setting Net::HTTP.http_logger_options for the current environment, a cryptic #<NoMethodError: undefined method 'info' for nil:NilClass> from lib/net-http-spy.rb:24 within Net::HTTP#initialize() is raised.
It appears that a similar issue was raised 2 years ago in issue #2 .
Work around
I fixed the issue by simply adding a config to the correct environment file. It was a pretty simple fix and was just carelessness on my part, but would it be appropriate to add a more descriptive error / initialize some sane defaults to prevent nils? If so, I would be willing to write a pull request / specs for it. Please let me know. Posting this issue up for now incase others have come across this error.
The problem:
If you include the gem in a project and attempt to make an HTTP request without first setting
Net::HTTP.http_logger_options
for the current environment, a cryptic#<NoMethodError: undefined method 'info' for nil:NilClass>
fromlib/net-http-spy.rb:24
withinNet::HTTP#initialize()
is raised.It appears that a similar issue was raised 2 years ago in issue #2 .
Work around
I fixed the issue by simply adding a config to the correct environment file. It was a pretty simple fix and was just carelessness on my part, but would it be appropriate to add a more descriptive error / initialize some sane defaults to prevent nils? If so, I would be willing to write a pull request / specs for it. Please let me know. Posting this issue up for now incase others have come across this error.