In my Gemfile
source 'https://rubygems.org'
ruby '2.1.0'
gem 'rails', '4.0.1'
gem "faraday"
gem "faraday_middleware"
gem "twitter", github: 'sferik/twitter'
if I run
$ bundle install
I get
Bundler could not find compatible versions for gem "faraday": In Gemfile:
twitter (>= 0) ruby depends on faraday (~> 0.9.0) ruby faraday (0.8.9)
TL;DR: Try running bundle update
.
Bundler tries to find gems that match in such a way that all their dependencies also match. So consider this:
In this case, Bundler will choose (or even downgrade) A to v1, so that you can A and C running next to each other.
However there are a couple of things that might prevent this from happening, and that will cause the error you are seeing:
bundle install
. You'd have to specifically say that it needs to recalculate the dependencies by running bundle update A
or for all the gems in your gemfile: bundle update
. My guess is that you are looking at scenario 2. You've already installed (and locked down on) version 0.8.9 of faraday. By adding twitter, your previous lock needs to be updated.
Be careful of running bundle update
without arguments however. It will try to get the latest versions of every gem in your gemfile, which might not be what you want.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.