bitpay / ruby-client

Powerful, flexible, lightweight SDK for the BitPay Bitcoin Payment Gateway API.
MIT License
79 stars 64 forks source link

Incompatibilities with current Rails versions. #58

Open silverdr opened 7 years ago

silverdr commented 7 years ago

Once added the line to Rails 5 application's Gemfile and trying to bundle install I get a number of error messages that seem to point to versions conflicts:

silverdr$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
  In snapshot (Gemfile.lock):
    rack (= 2.0.3)

  In Gemfile:
    rails-controller-testing was resolved to 1.0.2, which depends on
      actionpack (>= 5.0.1, ~> 5.x) was resolved to 5.0.5, which depends on
        rack (~> 2.0)

    bitpay-sdk was resolved to 2.1.0, which depends on
      rack (~> 1.5.2)

    rails-controller-testing was resolved to 1.0.2, which depends on
      actionpack (>= 5.0.1, ~> 5.x) was resolved to 5.0.5, which depends on
        rack-test (~> 0.6.3) was resolved to 0.6.3, which depends on
          rack (>= 1.0)

    sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
      sprockets (< 4.0, >= 2.8) was resolved to 3.7.1, which depends on
        rack (< 3, > 1)

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

Running bundle update doesn't help either - generates even more error messages:

$ bundle update
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.......................................
Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rails-controller-testing was resolved to 1.0.2, which depends on
      actionpack (>= 5.0.1, ~> 5.x)

    sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
      sprockets-rails (< 4.0, >= 2.0) was resolved to 3.2.0, which depends on
        actionpack (>= 4.0)
Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0) was resolved to 5.0.0, which depends on
        rack (~> 2.0)

    bitpay-sdk was resolved to 2.1.0, which depends on
      rack (~> 1.5.2)

    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0) was resolved to 5.0.0, which depends on
        rack-test (~> 0.6.3) was resolved to 0.6.3, which depends on
          rack (>= 1.0)

    sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
      sprockets (< 4.0, >= 2.8) was resolved to 3.7.1, which depends on
        rack (< 3, > 1)

Once the Gemfile line

gem 'bitpay-sdk', :require  => 'bitpay_sdk'

is removed or commented out, there are no errors at all.

rakvat commented 7 years ago

@silverdr did you see the discussion in https://github.com/bitpay/ruby-client/pull/56? -> using the master of the gem could help.

silverdr commented 7 years ago

@rakvat no, I didn't - thanks. But still - that PR seems to be open for many months now so I am hesitant to go further with this. I simply don't feel convinced that I can safely recommend it to my customers if things, especially on the financial side of the applications, require some kind of unofficial workarounds.

jocubeit commented 6 years ago

Can't use master with Rails 5.2.0.beta because it uses rack 2.0.3. Is there a requirement to lock the rack version down for this?

I agree with @silverdr, the PR has been open for almost 12 months, so I'm also hesitant and may need to look at forking and maintaining my own unofficial version - not an ideal situation!

Tatsuhiko-Nakagawa commented 5 years ago

@JurgenJocubeit I'm using Rails 5.2.2. I got the same rack error. So, I changed Gemfile like below and bundle worked for me.

gem 'bitpay-sdk', :require => 'bitpay_sdk', :git => 'https://github.com/bitpay/ruby-client'

jocubeit commented 5 years ago

@JurgenJocubeit I'm using Rails 5.2.2. I got the same rack error. So, I changed Gemfile like below and bundle worked for me.

gem 'bitpay-sdk', :require => 'bitpay_sdk', :git => 'https://github.com/bitpay/ruby-client'

I decided against BitPay, it may work from master but these guys don't care to reply to users of their official libraries. I decided to write my own bitcoin payment service and ditch BitPay.