Skip to content

Fix Base64 dependency warning #776

@bkuhlmann

Description

@bkuhlmann

Why

Hello. 👋 I'm seeing the following warnings when using this gem with Ruby 3.3.0:

warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. Also contact author of http-5.1.1 to add base64 into its gemspec.

How

Here's a quick script to reproduce:

#! /usr/bin/env ruby
# frozen_string_literal: true

# Save as `demo`, then `chmod 755 demo`, and run as `./demo`.

require "bundler/inline"

gemfile true do
  source "https://rubygems.org"
  gem "http"
end

Running the above will produce the warning mentioned above. The warning is due to this file (http-5.1.1/lib/http/chainable.rb:3) requiring base64.

Notes

The fix, add the following to the gemspec:

spec.add_dependency "base64", "~> 0.2"

Here's the environment I'm using:

  • macOS: macOS 13.6.3
  • Ruby: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [arm64-darwin22.6.0]
  • HTTP: 5.1.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions