-
Notifications
You must be signed in to change notification settings - Fork 557
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
Issue with ruby 2.4.0 #683
Comments
Interesting. StubSocket does have close method defined. Would you mind providing a sample code to reproduce the issue? |
I am also facing the same error after upgrading Ruby from version 2.3.2 to 2.4.0 in my Rails 5.0.0.1 application. My spec examples fails with the same error:
Below is the relevant code-snippet
Hope that helps in reproducing the error and fixing this issue. |
@jiggneshhgohel I can see you are using WebMock 2.1.0 Support for ruby 2.4.0 has been added in WebMock 2.3.1 @lokenmakwana what version of webmock do you use? |
@bblimke Thanks for your prompt response. I am updating my gem and will share the spec run results here. |
@bblimke Updating webmock gem from 2.1.0 to version 2.3.2 fixed the mentioned error in comment #683 (comment). Thanks a lot! |
I was also using WebMock 2.1.0 with ruby 2.4 Just upgraded to WebMock 2.3.2 and everything is fine. Thanks |
Modified gems: - json was updated because json 1.8.3 contained references to Bignum and Fixnum, which no longer exist in Ruby 2.4. - For webmock: bblimke/webmock#683
Closes codeforamerica#58. 2.4.2 is the latest version of ruby [supported by Heroku](https://devcenter.heroku.com/articles/ruby-support#supported-runtimes). The current version is causing deploys of this app to Heroku to fail. This also updates various dependencies in the lockfile using `bundle update #{name}` because of issues related to newer versions of ruby. - `json` [⚠](ruby/json#286) - `safe_yaml` [⚠](dtao/safe_yaml#67) - `webmock` [⚠] (bblimke/webmock#683) For folks that have this checked out locally, I also had to `brew install --force` to force an up to date build of `http_parse.rb`, which was throwing `Symbol not found: _rb_cFixnum`. Finally, this updates petharbor cassette to include URL encoded quotes - this is probably just an internal change to `URI.encode_www_form`.
I got lots of this: 1) Cronitor sets its config correctly has the specified options Failure/Error: response = Unirest.get( "#{API_URL}/monitors/#{URI.escape(name).gsub('[', '%5B').gsub(']', '%5D')}", headers: default_headers, auth: { user: token } ) NoMethodError: undefined method `close' for #<StubSocket:0x007f8de75d28a8> # ./lib/cronitor.rb:46:in `exists?' # ./lib/cronitor.rb:27:in `initialize' # ./spec/cronitor_spec.rb:17:in `new' # ./spec/cronitor_spec.rb:17:in `block (3 levels) in <top (required)>' # ./spec/cronitor_spec.rb:25:in `block (3 levels) in <top (required)>' # ------------------ # --- Caused by: --- # RestClient::ResourceNotFound: # 404 Resource Not Found # ./lib/cronitor.rb:46:in `exists?' Seems to be this issue which is fixed in webmock >= 2.3.1: bblimke/webmock#683 Simply updating seems to work fine.
I got lots of this: 1) Cronitor sets its config correctly has the specified options Failure/Error: response = Unirest.get( "#{API_URL}/monitors/#{URI.escape(name).gsub('[', '%5B').gsub(']', '%5D')}", headers: default_headers, auth: { user: token } ) NoMethodError: undefined method `close' for #<StubSocket:0x007f8de75d28a8> # ./lib/cronitor.rb:46:in `exists?' # ./lib/cronitor.rb:27:in `initialize' # ./spec/cronitor_spec.rb:17:in `new' # ./spec/cronitor_spec.rb:17:in `block (3 levels) in <top (required)>' # ./spec/cronitor_spec.rb:25:in `block (3 levels) in <top (required)>' # ------------------ # --- Caused by: --- # RestClient::ResourceNotFound: # 404 Resource Not Found # ./lib/cronitor.rb:46:in `exists?' Seems to be this issue which is fixed in webmock >= 2.3.1: bblimke/webmock#683 Simply updating seems to work fine.
To include Ruby 2.4 support: bblimke/webmock#683
The current version of Ruby, 2.3.1, is "In security maintenance phase (will EOL soon!)", so upgrade to the newest available stable version of Ruby. I had to update Webmock as well because the version we were on is incompatible with Ruby >= 2.4 [1] [1]: bblimke/webmock#683
The current version of Ruby, 2.3.1, is "In security maintenance phase (will EOL soon!)", so upgrade to the newest available stable version of Ruby. I had to update Webmock as well because the version we were on is incompatible with Ruby >= 2.4 [1] [1]: bblimke/webmock#683
The current version of Ruby, 2.3.1, is "In security maintenance phase (will EOL soon!)", so upgrade to the newest available stable version of Ruby. I had to update Webmock as well because the version we were on is incompatible with Ruby >= 2.4 [1] The change in `bin/build_summaries.rb` was prompted by a new Rubocop warning when I switched the target version to 2.5. [1]: bblimke/webmock#683
The current version of Ruby, 2.3.1, is "In security maintenance phase (will EOL soon!)", so upgrade to the newest available stable version of Ruby. I had to update Webmock as well because the version we were on is incompatible with Ruby >= 2.4 [1] The change in `bin/build_summaries.rb` was prompted by a new Rubocop warning when I switched the target version to 2.5. [1]: bblimke/webmock#683
The current version of Ruby, 2.3.1, is "In security maintenance phase (will EOL soon!)", so upgrade to the newest available stable version of Ruby. I had to update Webmock as well because the version we were on is incompatible with Ruby >= 2.4 [1] The change in `bin/build_summaries.rb` was prompted by a new Rubocop warning when I switched the target version to 2.5. [1]: bblimke/webmock#683
- Bumping to Ruby 2.5.3 and running specs generated: NoMethodError: undefined method `close' for #<StubSocket:0x007f871cf99070> Did you mean? closed? clone This turned ut to be Webmock, that had to be bumped > 2.3.2 see: bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
It fixes some compatibility issues with Ruby v2.4. Source: bblimke/webmock#683.
Problem: When running unit tests received undefined method error <NoMethodError: undefined method `close' for #<StubSocket:0x007fbacd90ee28> Solution: Update `webmock` based on bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
The version of WebMock used has issues with Ruby 2.4+ (although for some reason this hasn't come up on Travis until now) - c.f. bblimke/webmock#683 - Bump `webmock` gem to latest version - Change `stub_request` calls to use new basic auth syntax introduced with WebMock 2.0
Resolves #29 The listed version of webmock did not support ruby 2.4, so this path upgrades to the minimum compatible version (~> 2.3.1). See bblimke/webmock#683
Webmock added support for ruby 2.3.1 but the Socket#close method was not stubbed which causes integration test errors if the connection is closed. See bblimke/webmock#683. Bump webmock to at least 2.3.2, but less than 3, since 3 requires ruby 2.0
Webmock added support for ruby 2.3.1 but the Socket#close method was not stubbed which causes integration test errors if the connection is closed. See bblimke/webmock#683. Bump webmock to at least 2.3.2, but less than 3, since 3 requires ruby 2.0. Also bump vcr to a compatible versions to avoid tests trying to resolve DNS for bogus hostnames.
Webmock added support for ruby 2.3.1 but the Socket#close method was not stubbed which causes integration test errors if the connection is closed. See bblimke/webmock#683. Bump webmock to at least 2.3.2, but less than 3, since 3 requires ruby 2.0. Also bump vcr to a compatible versions to avoid tests trying to resolve DNS for bogus hostnames.
The webmock versions below 2.3.1 do not support ruby 2.4.0 and higher. Please see bblimke/webmock#683 for more details.
It fixes some compatibility issues with Ruby v2.4. Source: bblimke/webmock#683.
Requires updating webmock; see: bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
Requires updating webmock; see: bblimke/webmock#683
I am facing following error with ruby 2.4.0, It works fine with 2.3.3
The line causing is simply a Net::HTTP.post_form
The text was updated successfully, but these errors were encountered: