3

我遇到了与一年多前发布的上一个问题类似的问题。 如何在 Rails 3(捆绑器)中解决这个 gem 依赖问题?

我是 ROR 的新手。尝试bundle install在应用程序上运行时,我收到以下信息:

Could not find twitter-2.5.0 in any of the sources

我试图删除我的 Gemfile.lock。并bundle install再次尝试。并收到输出:

Bundler could not find compatible versions for gem "faraday":
  In Gemfile:
    twitter (>= 0) ruby depends on
      faraday (~> 0.8) ruby

    omniauth (~> 0.3.2) ruby depends on
      faraday (0.7.3)

结果来自gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.19, 3.0.10)
actionpack (3.0.19, 3.0.10)
activemodel (3.0.19, 3.0.10)
activerecord (3.0.19, 3.0.10)
activeresource (3.0.19, 3.0.10)
activesupport (3.0.19, 3.0.10)
addressable (2.3.3, 2.2.8)
arel (2.0.10)
bcrypt-ruby (3.0.1)
bitly (0.8.0)
bson (1.6.4)
bson_ext (1.6.2)
builder (2.1.2)
bundler (1.2.3)
capybara (1.1.2)
carrierwave (0.5.8)
carrierwave-mongoid (0.1.7)
chef (11.2.0)
childprocess (0.3.5)
crack (0.3.1)
devise (1.5.3)
diff-lcs (1.1.3)
erubis (2.6.6)
excon (0.16.1)
factory_girl (4.0.0)
factory_girl_rails (4.0.0)
faraday (0.8.5)
ffi (1.1.5)
fog (1.5.0)
formatador (0.2.3)
formtastic (1.2.4)
gibbon (0.3.5)
growl (1.0.3)
guard (1.3.2)
guard-rspec (1.2.1)
guard-spork (1.1.0)
haml (3.1.7)
haml-rails (0.3.4)
hashie (1.2.0)
highline (1.6.15)
httparty (0.8.3)
httpauth (0.2.0)
i18n (0.5.0)
ipaddress (0.8.0)
jquery-rails (1.0.19)
json (1.7.6)
jwt (0.1.5)
koala (1.6.0, 1.4.0)
libwebsocket (0.1.5)
linkedin (0.3.7)
listen (0.4.7)
log4r (1.1.10)
macaddr (1.6.1)
mail (2.2.19)
mime-types (1.21, 1.19)
mini_magick (3.4)
mixlib-authentication (1.3.0)
mixlib-cli (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.4.1)
mixlib-shellout (1.1.0)
mongo (1.6.2)
mongoid (2.2.6)
mongoid_slug (0.10.0)
mongoid_taggable (0.1.7)
multi_json (1.6.1, 1.0.4)
multi_xml (0.5.3, 0.4.4)
multipart-post (1.1.5)
net-ldap (0.2.2)
net-scp (1.0.4)
net-ssh (2.6.5, 2.5.2)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.1)
nokogiri (1.5.6, 1.5.5)
oa-basic (0.3.2)
oa-core (0.3.2)
oa-enterprise (0.3.2)
oa-more (0.3.2)
oa-oauth (0.3.2)
oa-openid (0.3.2)
oauth (0.4.7, 0.4.6)
ohai (6.16.0)
omniauth (1.1.3, 0.3.2)
omniauth-facebook (1.4.1)
omniauth-oauth2 (1.1.1)
orm_adapter (0.0.7)
polyglot (0.3.3)
pyu-ruby-sasl (0.0.3.3)
rack (1.2.8, 1.2.6, 1.2.3)
rack-mount (0.6.14)
rack-openid (1.3.1)
rack-test (0.5.7)
rails (3.0.19, 3.0.10)
rails_config (0.3.1)
railties (3.0.19, 3.0.10)
rake (10.0.3, 0.9.2)
rb-fchange (0.0.5)
rb-fsevent (0.9.1)
rb-inotify (0.8.8)
rdiscount (1.6.8)
rdoc (3.12.1, 3.12)
remarkable (4.0.0.alpha4)
remarkable_activemodel (4.0.0.alpha4)
remarkable_mongoid (0.6.0)
rest-client (1.6.7)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.2)
rspec-rails (2.11.0)
ruby-hmac (0.4.0)
ruby-openid (2.2.0)
ruby-openid-apps-discovery (1.2.0)
rubygems-bundler (1.1.0)
rubyntlm (0.1.1)
rubyzip (0.9.9)
rvm (1.11.3.6)
sass (3.2.1)
selenium-webdriver (2.25.0)
simple-navigation (3.8.0)
simple_oauth (0.2.0)
soloist (0.9.7)
spork (0.9.2)
sqlite3 (1.3.7)
sqlite3-ruby (1.3.3)
stringex (1.4.0)
subexec (0.2.2)
systemu (2.5.2)
thor (0.14.6)
treetop (1.4.12)
twitter (4.5.0)
tzinfo (0.3.35, 0.3.29)
uuid (2.3.5)
warden (1.2.1) 
will_paginate (2.3.16)
XMLCanonicalizer (1.0.1)
xpath (0.1.4)
yajl-ruby (1.1.0)

宝石文件:

source 'http://rubygems.org'

gem 'rails', '~> 3.0.19'

#gem 'sqlite3-ruby', :require => 'sqlite3'
gem "haml-rails"
gem "sass"
gem "mongoid"
gem "mongo", "1.6.2"
gem "bson_ext", "1.6.2"
gem 'formtastic', '~> 1.2'
gem 'devise', '~> 1.4'
gem "declarative_authorization", :git => 'git://github.com/opusmagnum/declarative_authorization.git'
gem 'mongoid_taggable'
gem 'rdiscount'
gem "simple-navigation", "~> 3.6"
gem "will_paginate", "~> 2.3.16"
gem 'mongoid_slug', :require => 'mongoid/slug'
gem "omniauth", "~> 0.3.2"
gem "twitter" 
gem "koala"
gem "bitly"
gem "linkedin"
gem "rails_config"
gem 'gibbon', '~> 0.1'
gem 's3_swf_upload', :git => 'git://github.com/nathancolgate/s3-swf-upload-plugin'
gem 'carrierwave'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem 'fog'
gem "mini_magick", "~> 3.3"
gem "jquery-rails"

group :test, :development do
  gem "factory_girl_rails"
  gem 'rspec-rails'
  gem 'capybara'
  gem 'remarkable_mongoid'
  gem 'spork'
  gem 'guard'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'rb-fsevent'
  gem 'growl'
end

我也尝试了添加gem 'twitter', :git => 'https://github.com/sferik/twitter.git'到我的 gemfile 的建议,但也没有运气。

任何帮助,将不胜感激。谢谢。

4

2 回答 2

3

Gemfile 中的一些 gem 被锁定到某些版本。这可能会在进行更新时产生问题,并且当您删除 Gemfile.lock 时,任何未锁定到版本的内容都会为最新的可能版本打开。通常我不认为删除锁定文件是一种好习惯。

相反,您应该运行bundle update gemfile_name以更新特定的 gem。运行bundle update将尝试将所有 gem 更新到版本约束允许的最新版本。

如果您查看 Gemfile.lock 文件(与 不同gem list),您将看到 gem、它们的版本以及它们的依赖项。

基于此,您应该能够找出加载法拉第作为依赖项,并尝试放宽版本约束。

于 2013-02-20T05:59:38.837 回答
2

This answer is very late, but you inadvertently upgraded the twitter gem, which was yanked as gruzy notes in a comment here.

Just specify another repo, with a tag that's not broken for you and does not conflict with faraday. For me, this was:

gem 'twitter', :git => 'https://github.com/sferik/twitter.git', :tag => 'v2.2.0'

You probably just replace v2.2.0 with v2.5.0, and the breakage should be gone.

于 2013-08-02T03:48:33.423 回答