2

For some reason, my project has messed up and now its throwing errors every time I try to run bundle install. Somem of the errors i've managed to fix by reordering the gems in my Gemfile, but now i'm getting this one:

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)

I thought that using bundler was supposed to erase dependency wtf's? I'm assumingn this message means that two gems want 2 different versions of faraday..?

How can I fix this problem though? Why doesn't it just install both versions, and each gem loads the version it wants?

I'd love some help on this please!

Thanks

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
noli
  • 15,927
  • 8
  • 46
  • 62
  • Did you try deleting the Gemfile.lock file? – pthesis Jul 02 '11 at 22:15
  • I tried deleting the Gemfile.lock, I tried `rm -rf vendor/bundle`, for a diffrent problem I even tried rolling back two commits in my repo, but something must have been left over. I'm seriously confused here – noli Jul 02 '11 at 22:18
  • 1
    I just used your Gemfile in a new project and it worked fine. :/ – Dex Jul 02 '11 at 22:25
  • ok.. so another wtf then.. =/ I dunno.. – noli Jul 02 '11 at 22:27
  • 1
    You may also have two versions installed. You can do a `gem list` to see. Then you can `gem uninstall faraday` and it will ask you which version you want to uninstall. – Dex Jul 03 '11 at 01:54
  • ah... that might have been part of it! I had faraday 0.6.1. installed globally, and the later version installed locally. Maybe that was part of it. I've nuked the old setup though, so no way to test to be sure. Thanks for the input though – noli Jul 03 '11 at 02:37

3 Answers3

5

The specific version of Omniauth that you're using depends on Faraday ~> 0.7.3, while the latest released version of Twitter gem needs 0.6.

You can fix this by using the latest version of Twitter gem from the repository.

gem 'twitter', :git => 'https://github.com/jnunemaker/twitter.git'
Dogbert
  • 212,659
  • 41
  • 396
  • 397
  • 1
    Thank you, i'm going to try that. From your answer though.. does that mean that I'm going to run into this again if gem developers all have different dependency versions? IS there anything I can do personally to avoid this, instead of hoping the gem developer fixes it? – noli Jul 02 '11 at 22:26
  • @Noli, I'm not sure, but I think you cannot do anything (other than editing the dependencies of the gems yourself and hoping nothing crashes). There's no way to load 2 separate versions of a single gem. – Dogbert Jul 02 '11 at 22:29
  • Ok, thanks.. your solution worked, and updating my rubygems and bundler versions also fixed a few other things. Thanks! – noli Jul 02 '11 at 22:42
  • @Noli, if you run into this issue in the future, look into Ruby Version Manager (RVM). See also [this link on rvm](http://www.railway.at/2010/02/13/avoiding-rails-3-dependency-hell-with-rvm/) – Eric Hu Jul 03 '11 at 08:57
  • @Eric Hu, how would that help? You cannot load 2 versions of the same gem in a single application at once. – Dogbert Jul 03 '11 at 09:00
  • I could've sworn that I read somewhere that RVM will install two separate versions and create the appropriate links when you have a split version dependency of the same gem. I'm having trouble finding the link, so disregard my comment for now (I'll delete my comments later if I can't) – Eric Hu Jul 03 '11 at 09:13
  • @Eric Hu, Did you mean RVM Gemsets? You certainly can create sandboxes with Gemsets, but I don't think it's possible to load the same gem twice in the same app. – Dogbert Jul 03 '11 at 10:21
  • @Dogbert yeah, I was referring to gemsets. I was under the impression that some tool (either Bundler or RVM) allowed for gem dependencies on different version of the same gem. I just spent another 2 hours looking for the source I thought I read, but I'm ready to admit that I just must be crazy =P – Eric Hu Jul 03 '11 at 22:02
1

I had the exact same issue and it got resolved by the following two lines in my Gemfile:

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

try deleting your Gemfile.lock (file) and then do

bundle install
Magesh
  • 760
  • 7
  • 16