[英]Gemfile Twitter + Faraday
In my Gemfile 在我的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:
Bundler找不到与宝石“ faraday”兼容的版本:在Gemfile中:
twitter (>= 0) ruby depends on faraday (~> 0.9.0) ruby faraday (0.8.9)
TL;DR: Try running bundle update
. TL; DR:尝试运行
bundle update
。
Bundler tries to find gems that match in such a way that all their dependencies also match. Bundler试图找到匹配的宝石,使得它们的所有依赖项也都匹配。 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. 在这种情况下,Bundler将选择(甚至降级)A到v1,以便A和C彼此相邻运行。
However there are a couple of things that might prevent this from happening, and that will cause the error you are seeing: 但是,有几件事可能会阻止这种情况的发生,并且会导致您看到的错误:
bundle install
. 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
. bundle update A
或对gemfile: bundle update
所有gem重新计算依赖性。 My guess is that you are looking at scenario 2. You've already installed (and locked down on) version 0.8.9 of faraday. 我的猜测是您正在研究场景2。您已经安装了法拉第0.8.9版(并已将其锁定)。 By adding twitter, your previous lock needs to be updated.
通过添加推特,您之前的锁需要更新。
Be careful of running bundle update
without arguments however. 但是,请谨慎运行不带参数的
bundle update
。 It will try to get the latest versions of every gem in your gemfile, which might not be what you want. 它将尝试获取您的gemfile中每个宝石的最新版本,而这可能不是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.