Skip to content
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

Compatibility issues with Ruby greater or equal to 2.7 #15

Closed
hgeorgilas opened this issue May 5, 2020 · 2 comments · Fixed by #21
Closed

Compatibility issues with Ruby greater or equal to 2.7 #15

hgeorgilas opened this issue May 5, 2020 · 2 comments · Fixed by #21

Comments

@hgeorgilas
Copy link
Contributor

hgeorgilas commented May 5, 2020

I tried using this gem with Ruby 2.7.1 and I got the following error

#<FrozenError: can't modify frozen String: "">

It seems the issue is the http.rb version dependency you declare in your gemspec file.

spec.add_dependency 'http', '~> 3.0'

This issue seems to be fixed on the 4.2.1 version of http.rb

Maybe bumping the dependency version would be enough.

Full Stack trace

".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/http-3.3.0/lib/http/response/body.rb:52:in `force_encoding'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/http-3.3.0/lib/http/response/body.rb:52:in `to_s'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/faraday-http-80c9bedffbb2/lib/faraday/adapter/http.rb:29:in `perform_request'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/faraday-http-80c9bedffbb2/lib/faraday/adapter/http.rb:16:in `call'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday_middleware-1.0.0/lib/faraday_middleware/response_middleware.rb:36:in `call'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday_middleware-1.0.0/lib/faraday_middleware/response/follow_redirects.rb:79:in `perform_with_redirection'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday_middleware-1.0.0/lib/faraday_middleware/response/follow_redirects.rb:67:in `call'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday-1.0.1/lib/faraday/request/retry.rb:148:in `call'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday-1.0.1/lib/faraday/request/url_encoded.rb:25:in `call'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday-1.0.1/lib/faraday/rack_builder.rb:153:in `build_response'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday-1.0.1/lib/faraday/connection.rb:492:in `run_request'",
 ".rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/faraday-1.0.1/lib/faraday/connection.rb:198:in `get'",

Thanks

EDIT:
Cloned the repo locally, updated gemspec dependency of http.rb to
spec.add_dependency 'http', '~> 4' specs seems to be passing.
Have not tested further than that though.

@olleolleolle
Copy link
Member

Please make a PR, it'd help a lot!

@hgeorgilas
Copy link
Contributor Author

@olleolleolle PR opened #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants