2013-02-20 158 views
1

我遇到了与上一个问题类似的问题,这是一年前发布的。 How do I fix this gem dependency problem in Rails 3 (bundler)?宝石依赖冲突

我是新来的ROR。当试图在应用程序运行bundle install,我收到以下:

Could not find twitter-2.5.0 in any of the sources

我试图DELET我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) 

的Gemfile:

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的建议,但还没有运气。

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

+0

你可以发布你运行'gem list'的结果吗? – Fishz 2013-02-20 03:24:30

+0

你有什么理由为什么你使用omniauth的'0.3.2'版本? – crftr 2013-02-20 03:28:08

+0

twitter gem version 2.5.0最近已被抽出。 https://rubygems.org/gems/twitter/versions/2.5.0 这是否有意义? – grzuy 2013-02-20 03:55:50

回答

1

这个答案很晚,但是你无意中升级了twitter gem,在这里的评论中这个twitter被扯成了一些粗糙的音符。

只需指定另一个回购,标签不会因您而中断,也不会与法拉第相冲突。对我来说,这就是:

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

你可能只是v2.5.0取代v2.2.0和破损应消失。

3

Gemfile中的某些宝石被锁定到某些版本。这可能会在更新时造成问题,并且当您删除Gemfile.lock时,任何未锁定到某个版本的内容都将打开以供最新版本使用。通常我不认为吹走锁文件是一种好习惯。

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

如果你看看你的Gemfile.lock文件(与gem list不一样),你会看到宝石,它们的版本以及它们的依赖关系。

基于此,您应该能够找出将faraday作为依赖加载的内容,并尝试放松版本约束。