Skip to content

Commit d04973e

Browse files
committed
Fix a lint error that occurred when using Ruby 3.4
In Ruby 3.4, base64 is no longer part of the standard library, which was causing the following error. ``` Run bundle exec rake rubocop bundle exec rake rubocop shell: /usr/bin/bash -e {0} rubocop -c .rubocop.yml --display-only-fail-level-offenses -D /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/lib/rubocop/formatter/html_formatter.rb:5: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0. You can add ostruct to your Gemfile or gemspec to silence this warning. /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/lib/rubocop/formatter/html_formatter.rb:6: 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. /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': cannot load such file -- base64 (LoadError) from /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/lib/rubocop/formatter/html_formatter.rb:6:in '<top (required)>' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/lib/rubocop.rb:669:in 'Kernel#require_relative' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/lib/rubocop.rb:669:in '<top (required)>' from /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' from /opt/hostedtoolcache/Ruby/3.4.6/x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rubocop-1.24.1/exe/rubocop:6:in '<top (required)>' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/bin/rubocop:25:in 'Kernel#load' from /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/bin/rubocop:25:in '<main>' rake aborted! Command failed with status (1): [rubocop -c .rubocop.yml --display-only-fail-level-offenses -D] /home/runner/work/ruby-http-client/ruby-http-client/Rakefile:9:in 'block in <top (required)>' /home/runner/work/ruby-http-client/ruby-http-client/vendor/bundle/ruby/3.4.0/gems/rake-13.3.0/exe/rake:27:in '<top (required)>' /opt/hostedtoolcache/Ruby/3.4.6/x64/bin/bundle:25:in 'Kernel#load' /opt/hostedtoolcache/Ruby/3.4.6/x64/bin/bundle:25:in '<main>' ```
1 parent 54e4e17 commit d04973e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
- run: make install
3434

3535
- name: Set up linter
36-
run: bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
36+
run: |
37+
bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
38+
bundle add base64 --group "development" --skip-install
3739
if: ${{ matrix.ruby != '2.4' }}
3840

3941
- run: bundle install --with development

0 commit comments

Comments
 (0)