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

open(uri) is deprecated in Ruby 2.7 #83

Open
rledousa opened this issue Jan 28, 2021 · 0 comments
Open

open(uri) is deprecated in Ruby 2.7 #83

rledousa opened this issue Jan 28, 2021 · 0 comments

Comments

@rledousa
Copy link

Starting puppet-forge-server with Ruby 2.7 fails with

[2021-01-27 23:57:17] DEBUG Fetching data for url: https://forgeapi.puppetlabs.com/v3/modules/puppetlabs-stdlib from remote server
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-forge-server-1.10.1/lib/puppet_forge_server/http/http_client.rb:89: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

Offending line is http_client.rb:89

I'm not a Ruby developer so I don't know how best to submit a patch which covers the various Ruby versions out there, but changing open(url, @uri_options) -> OpenURI.open_uri(url, @uri_options) fixes the problem

/opt/puppetlabs/puppet/bin/ruby --version

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

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

No branches or pull requests

1 participant