如何修复Rails 3(bundler)中的这个gem依赖问题?

由于某种原因,每次我尝试运行bundle install时,我的项目都搞砸了,现在它的抛出错误。 通过重新排序我的Gemfile的gem,我设法解决了一些错误,但现在我得到了这个:

 Bundler could not find compatible versions for gem "faraday": In Gemfile: omniauth depends on faraday (~> 0.7.3) twitter depends on faraday (0.6.1) 

我认为使用bundler应该删除依赖wtf's ? 我假设这个消息意味着两个gem需要2个不同版本的faraday ..?

我怎么能解决这个问题呢? 为什么不安装这两个版本,每个gem加载它想要的版本?

我喜欢这方面的帮助!

谢谢

Gemfile.lock: https ://gist.github.com/1061722

的Gemfile:

 # Edit this Gemfile to bundle your application's dependencies. source 'http://rubygems.org' gem 'rails', '3.0.9' #, :git => 'git://github.com/rails/rails.git' gem "haml-rails" gem "jquery-rails" # Gem to abstract away the dplication common in standard restful controllers gem 'inherited_resources' # Allows us to keep an order of a user's items in their collection gem "acts_as_list" # Used to simplify user registrations and logins # Pined to ref, as there is problem on devise HEAD gem "devise", :git => "git://github.com/plataformatec/devise.git", :ref => '4964f53a42a3d434ee6d731d6f999d8dae13dada' # Might not be used gem "ajaxful_rating" # Facilitates Edit-in-place functionality for certain data fields gem "best_in_place", :git => 'git://github.com/moabite/best_in_place.git' # Gem for uploading images. More flexible than "paperclip" gem "carrierwave", :git => 'git://github.com/jnicklas/carrierwave.git' gem "fog" # Apparently needed to make the uploadify multifile uploader work gem "flash_cookie_session" # Used to that we can resize images uploaded through carrierwave, using # ImageMagick gem "rmagick" # Easily create database models for site simulation gem "factory_girl_rails" # Useful for fake data generation gem "faker" gem "randexp" gem "random_data" gem 'forgery' gem "lorempixum", :require => 'lorempixum' gem "hashie" # gem 'aws-s3', :require => 'aws/s3' # gem 'bcrypt-ruby', :require => 'bcrypt' # Provides a shorter syntax for building forms gem 'formtastic' # Sends notifications of errors on Production app gem "hoptoad_notifier" # Social Media Gems FB Connect, FB, and Twitter gem "omniauth", :git => "git://github.com/intridea/omniauth.git" ,:ref => "b9fe79961ab56041dbf9" gem "fb_graph" gem "twitter" gem 'rake', '0.8.7' gem "jammit" gem "rest-client" gem 'rails-erd', :git => "git://github.com/voormedia/rails-erd.git" gem "nokogiri" group :development, :test do gem "guard" gem "guard-ego" gem "guard-bundler" gem "guard-jammit" gem "guard-rails" gem "guard-rspec" gem "guard-shell" gem "guard-compass" gem "guard-livereload" gem 'rb-fsevent', :require => false gem "rb-inotify", :require => false gem "libnotify", :require => false # Needed to run html2haml to convert html to haml gem "hpricot" gem "taps" gem "heroku" #gem "heroku-rails", :git => "git://github.com/railsjedi/heroku-rails.git" gem "heroku-rails", :git => "git://github.com/sid137/heroku-rails.git" gem "sqlite3-ruby", :require => 'sqlite3' gem "ruby-debug19", :require => 'ruby-debug' # nice table displays in Rails console gem "hirb" gem "facebook_test_users", :git => "git://github.com/sid137/facebook_test_users.git" # Allows us to push the local development database up to Heroku, and pull the # heroku db down locally gem "yaml_db" gem "escape_utils" # Sass and Blueprint based css framework for dev machine # use "compass compile . " to compile css before deployment gem "compass", ">=0.11.1" # Print a header in app/model/*.rb files, listing the db columns present for # each model gem "selenium-webdriver" gem "rack-test" gem "capybara", :require => 'capybara/rspec' gem "launchy" gem 'database_cleaner', :git => 'git://github.com/bmabey/database_cleaner.git' gem "rspec-core", "2.6.4" gem "rspec-rails"# , '2.6.0' #, '2.5.0' #gem 'shoulda-matchers', :git => 'git://github.com/thoughtbot/shoulda-matchers.git' #gem 'shoulda-matchers', :git => 'git://github.com/sid137/shoulda-matchers.git' gem "ZenTest" gem "autotest-rails" end 

您正在使用的Omniauth的特定版本取决于法拉第〜> 0.7.3,而Twittergem的最新发布版本需要0.6。

您可以通过使用存储库中的最新版本的Twitter gem来解决此问题。

 gem 'twitter', :git => 'https://github.com/jnunemaker/twitter.git' 

我有完全相同的问题,它通过我的Gemfile中的以下两行解决:

 gem 'twitter', :git => 'https://github.com/jnunemaker/twitter.git' gem 'omniauth', :git => "git://github.com/intridea/omniauth.git" ,:ref => "b9fe79961ab56041dbf9" 

尝试删除您的Gemfile.lock(文件),然后执行

 bundle install