Search code examples
ruby-on-railsbundler

Superclass conflict in two gem dependencies


I'm adding 2 gems to Gemfile:

gem 'ethereum'
gem 'nem-ruby', require: 'nem'

bundle install --path vendor/bundle works just fine, however when I am trying to run bundle exec rails c (or any other bundle exec) I've got error:

 superclass mismatch for class Digest::SHA3 (Digest::Class is given but was Digest::Base) (TypeError)

In Gemfile.lock I see the following:

 ...
 ethereum (0.5.2)
      activesupport
      sha3-pure-ruby (= 0.1.1)
 nem-ruby (0.0.12)
      base32 (~> 0.3)
      digest-sha3 (~> 1.1)
      faraday (~> 0.11)
      faraday_middleware (~> 0.11)
...

As far, as I understand, this error is caused by the digest-sha3 and sha3-pure-ruby dependencies. They both have Digest::SHA3 class, but one of them inherits Object and other Digest::Class.

Is there any way to make it work?


Solution

  • Unfortunately, you can't do much with it.

    You can find the answer here https://stackoverflow.com/a/4497478/6745294