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

Add base64 as a runtime dependency to fix the LoadError in Ruby 3.4 #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taketo1113
Copy link

This pull request has been created to address the LoadError for the base64 gem in Ruby 3.4.

This error occurs because base64 is no longer included in the default gems starting from Ruby 3.4.
https://bugs.ruby-lang.org/issues/19351

The error message is following:

irb(main):001> require 'em-websocket'
/my-app/tmp/ruby/3.4.0+0/gems/em-websocket-0.5.3/lib/em-websocket.rb:14: warning: base64 was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add base64 to your Gemfile or gemspec to silence this warning.
/Users/taketo/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/bundled_gems.rb:76:in 'Kernel.require': cannot load such file -- base64 (LoadError)
	from /Users/taketo/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/bundled_gems.rb:76:in 'block (2 levels) in Kernel#replace_require'
	...
  • ruby: 3.4-dev (ruby 3.4.0dev (2024-10-29T07:56:32Z master 21b3dfa03b) +PRISM [arm64-darwin23])
  • em-websocket: 0.5.3

Details

This Pull Request changes to add base64 as a runtime dependency to fix the LoadError in Ruby 3.4. (Fix #160)

Additionally, the required_ruby_version has been added to the gemspec to restrict the Ruby version to 2.4.0 or higher.
This is to explicitly specify compatibility, as the base64 gem is only available for Ruby 2.4 and above.
https://github.com/ruby/base64/blob/v0.2.0/base64.gemspec#L17

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 this pull request may close these issues.

Add base64 to gemfile or gemspec
1 participant