开发者

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 h开发者_Go百科ave 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?


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.


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).


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜