Skip to content

Ruby 3.4: LoadError: cannot load such file -- base64 from telesign/lib/telesign/rest.rb (missing runtime dep on base64) #13

@MathyouMB

Description

@MathyouMB

Summary
On Ruby 3.4+, base64 is no longer a default stdlib; it’s a bundled gem. The telesign gem does require "base64" in lib/telesign/rest.rb but doesn’t declare base64 as a runtime dependency. This causes LoadError when using telesignenterprise on Ruby 3.4.

Affected

  • telesignenterprise ≥ 2.2.x (observed 2.2.2, 2.5.0, 2.6.0)
  • telesign (observed 2.2.5, 2.3.1, 2.4.0)

Steps to Reproduce

# Ruby 3.4.x
ruby -v  # => ruby 3.4.0...

# Minimal Gemfile
cat > Gemfile <<'G'
source "https://rubygems.org"
gem "telesignenterprise", "2.6.0"   # also reproducible on 2.2.2 / 2.5.0
G

bundle install
bundle exec ruby -e 'require "telesignenterprise"; puts "loaded"'

Actual Behavior

/.../gems/telesign-2.4.0/lib/telesign/rest.rb:4:in `<top (required)>':
cannot load such file -- base64 (LoadError)

Expected Behavior
Gem loads without requiring the application to manually add gem "base64".

Why this happens
From Ruby 3.4, base64 was moved out of the default set and distributed as a bundled gem. Libraries that require "base64" must declare a dependency on it.

Proposed Fix
Add a runtime dependency on base64 (ideally in telesign.gemspec, since that’s where the require "base64" lives):

# telesign.gemspec
+ spec.add_dependency "base64"

If you prefer to patch on the enterprise wrapper as a stop-gap:

# telesignenterprise.gemspec
+ spec.add_dependency "base64"

Workaround for users
Add to your app’s Gemfile:

gem "base64"

Environment

  • Ruby: 3.4.0 (arm64-darwin)
  • Bundler: 2.x
  • telesignenterprise: 2.6.0 (also 2.5.0 / 2.2.2)
  • telesign: 2.4.0 (also 2.3.1 / 2.2.5)

Additional Notes

  • The error originates in telesign/lib/telesign/rest.rb (require "base64").
  • Consider adding Ruby 3.4 to CI to catch bundled-stdlib regressions.

Metadata

Metadata

Assignees

No one assigned

    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