2011-07-02 41 views
2

出於某種原因,我的項目每次嘗試運行bundle install時都搞砸了,現在出現了拋出錯誤。 Somem我已經設法通過我的Gemfile重新排序的寶石來修復錯誤的,但現在我得到這樣一個:如何在Rails 3(bundler)中修復這個gem dependency問題?

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) 

我想到用打捆應該刪除依賴wtf's?我假設這條消息意味着兩個寶石想要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 
+0

你可以發佈你的Gemfile嗎? – Dex

+0

您是否嘗試刪除Gemfile.lock文件? – pthesis

+0

我嘗試刪除Gemfile.lock,我嘗試了'rm -rf vendor/bundle',對於一個不同的問題,我甚至嘗試在我的回購中回滾兩個提交,但是必須留下一些東西。我在這裏很困惑 – noli

回答

5

您使用Omniauth的具體版本取決於法拉第〜> 0.7.3,而最新發布的Twitter寶石版本需要0.6。

您可以通過使用存儲庫中最新版本的Twitter gem來解決此問題。

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

謝謝,我會嘗試。從你的答案,雖然..這是否意味着如果寶石開發人員都有不同的依賴版本,我會再次遇到這個問題?有什麼我可以親自去做,以避免這種情況,而不是希望寶石開發者修復它? – noli

+0

@Noli,我不確定,但我認爲你不能做任何事情(除了自己編輯寶石的依賴關係並希望沒有任何崩潰)。無法加載單個寶石的兩個單獨版本。 – Dogbert

+0

好的,謝謝..您的解決方案能夠工作,更新我的rubygems和bundler版本也修復了其他一些問題。謝謝! – noli

1

我有相同的問題,並得到了由以下兩行我的Gemfile解決:

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

嘗試刪除Gemfile.lock的(文件),然後做

bundle install