Faraday: Gem Load Error ruby2_keywords v0.0.3

Created on 19 Jan 2021  ·  5Comments  ·  Source: lostisland/faraday

Basic Info

  • Faraday Version: 1.3.0
  • Ruby Version: 2.4.1

Issue description

Please provide a description of the issue you're experiencing.

Please also provide the exception message/stacktrace or any other useful detail.

.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'faraday'.
Gem Load Error is: wrong number of arguments (given 2, expected 1)
Backtrace for gem load error is:
/gems/ruby-2.4.1@myproject/gems/ruby2_keywords-0.0.3/lib/ruby2_keywords.rb:2:in `private_method_defined?'
/gems/ruby-2.4.1@myproject/gems/ruby2_keywords-0.0.3/lib/ruby2_keywords.rb:2:in `<class:Module>'
/gems/ruby-2.4.1@myproject/gems/ruby2_keywords-0.0.3/lib/ruby2_keywords.rb:1:in `<top (required)>'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/gems/ruby-2.4.1@myproject/gems/faraday-1.3.0/lib/faraday/rack_builder.rb:3:in `<top (required)>'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/gems/ruby-2.4.1@myproject/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/gems/ruby-2.4.1@myproject/gems/faraday-1.3.0/lib/faraday.rb:20:in `<top (required)>'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `require'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `block (2 levels) in require'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `each'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `block in require'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `each'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `require'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in `require'
/Users/asdf123/myproject/config/application.rb:9:in `<top (required)>'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
/gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
 (Bundler::GemRequireError)
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:80:in `block (2 levels) in require'
from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `each'
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `block in require'
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `each'
from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `require'
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in `require'
    from /Users/asdf123/myptoject/config/application.rb:9:in `<top (required)>'
from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
    from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
    from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
    from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
    from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /gems/ruby-2.4.1@myproject/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'

Steps to reproduce

Just upgrade, bundled and then tried to run the project: faraday (1.3.0) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords faraday_middleware (1.0.0) faraday (~> 1.0) ruby2_keywords (0.0.3)

help wanted

Most helpful comment

All 5 comments

This affects Ruby 2.5 and before.

Ruby 2.5 support not given by 0.0.3: https://github.com/ruby/ruby2_keywords/issues/9 - it uses the 2-argument version of a method, the 2nd argument was introduced in 2.6.

Thanks for raising this @silviusimeria, I found a related issue in ruby2_keyword: https://github.com/ruby/ruby2_keywords/issues/9

It seems you're not the only one affected and there already people working on a fix!
I'd give it a few hours to see how things pan out, if they fix the issue and push a v0.0.4, then we can avoid an extra release with just the version lock 😃

For now, should this be an issue for anyone, please lock the ruby2_keyword in your Gemfile as a temporary fix until we decide what to do here 👍

@silviusimeria the fix states compatibility with Ruby 2.5, but I see you're on Ruby 2.4, could you double-check and confirm if this is working for you as well now?

Seems to be working with 2.4 as well.

Was this page helpful?
0 / 5 - 0 ratings