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

Rails6 Incompability for 1.0.45 #44

Open
feapaydin opened this issue Mar 2, 2020 · 0 comments
Open

Rails6 Incompability for 1.0.45 #44

feapaydin opened this issue Mar 2, 2020 · 0 comments

Comments

@feapaydin
Copy link

Rails: 6.0.2.1
Ruby: 2.7.0p0 (2019-12-25 revision 647ee6f091)
Bundler: 2.1.4

Release 1.0.45 seems to fail when installing with bundler in Rails6.

I have created a brand new Rails6 project and added iyzipay to the gemfile.
When I run bundle, bundler installs version 1.0.44 of the gem,
which depends on rest-client ~> 1.8, which is not working properly as tests shows that:

...
KeyError:
      key not found: :ciphers
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `fetch'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `initialize'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `new'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
      # /Users/furkanenes/.rvm/gems/ruby-2.7.0/gems/rest-client-1.8.0/lib/restclient.rb:69:in `post'
      # ./lib/iyzipay/http_client.rb:8:in `post'
      # ./lib/iyzipay/model/threeds_payment.rb:12:in `retrieve'
      # ./spec/threeds_payment_spec.rb:218:in `block (2 levels) in <top (required)>'
...
# Same error occurs in all 39 tests

I believe this is a rest-client related problem due to this issue.

The solution is simply updating rest-client to ~> 2.0, which is already done in iyzipay 1.0.45.
But the problem is that when you force bundler to install iyzipay 1.0.45 in your gemfile, like:

gem 'iyzipay', '~> 1.0.45'
# or
gem 'iyzipay', '1.0.45'

Following output occurs when you run bundle:

Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
  In snapshot (Gemfile.lock):
    rack (= 2.2.2)

  In Gemfile:
    rails (~> 6.0.2, >= 6.0.2.1) was resolved to 6.0.2.1, which depends on
      actionpack (= 6.0.2.1) was resolved to 6.0.2.1, which depends on
        rack (~> 2.0, >= 2.0.8)

    iyzipay (~> 1.0.45) was resolved to 1.0.45, which depends on
      rack (~> 1.6.4)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

I think the problem is that rack dependency of rails6 (actionpack 6) fails to comply with iyzipay rack dependency, which is 1.6.4.

I have forked the repository and updated rack dependency to 2.0, which forced me to update rspec and rspec-rails dependencies to 3.8.0.

Currenty the tests and my rails6 project are working perfectly well but further testing is required in order to maintain backwards compability of the gem.

I'll generate a PR and hope that this simple solution works for everybody.

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

No branches or pull requests

1 participant