ben
ben

Reputation: 29777

How can I change the version of a gem that one of my gems depends on?

I am trying to use the evernote gem. It relies on the thrift gem.

Gemfile

gem 'evernote'

When I try to use it, I get this error:

Thrift::ProtocolException in PagesController#the_lab 
No version identifier, old protocol client?
thrift (0.5.0) lib/thrift/protocol/binary_protocol.rb:122:in `read_message_begin'
thrift (0.5.0) lib/thrift/client.rb:45:in `receive_message'
evernote (0.9.0) vendor/gen-rb/evernote/edam/note_store.rb:97:in `recv_listNotebooks'

There is a newer version of the thrift gem available, which could potentially fix the problem. When I try to install it, I get this error:

Gemfile:

gem 'evernote'
gem 'thrift', "~> 0.6.0"

Console:

$ bundle install
Fetching source index for http://rubygems.org/
You have requested:
  thrift ~> 0.6.0

The bundle currently has thrift locked at 0.5.0.
Try running `bundle update thrift`

$ bundle update thrift
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "thrift":
  In Gemfile:
    evernote depends on
      thrift (~> 0.5.0)

    thrift (0.6.0)

Is there a way I can change the version of thrift that evernote relies on?

Upvotes: 2

Views: 2494

Answers (3)

hnprashanth
hnprashanth

Reputation: 831

Fork evernote gem & edit your gemfile to refer to that. Edit .gemspec of your forked evernote gem to match the version of thrift.

Upvotes: 1

lebreeze
lebreeze

Reputation: 5134

You 'could' fork the evernote gem, update it to use the appropriate version of thrift and then use that in your app?

Gemfile

gem 'evernote', :git => "https://github.com/your_username/evernote.git

Then send cgs a pull request if relevant.

Upvotes: 3

David Sulc
David Sulc

Reputation: 25994

Try this:

  1. Remove the reference to thrift in you Gemfile
  2. Run bundle update evernote

It seems the latest version of evernote doesn't depend on a specific version of thrift, so that should solve your issue. If not, try having both evernote and thrift in your Gemfile and updating both (which should result in your having the latest versions of both gems).

Upvotes: 1

Related Questions