ruby-on-rails - 我如何解决 Rails 3 (bundler) 中的 gem 依赖问题?

标签 ruby-on-rails rubygems bundler omniauth faraday-oauth

由于某种原因,我的项目搞砸了,现在每次我尝试运行 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

gem 文件:

# 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版本取决于Faraday ~> 0.7.3,而最新发布的Twitter gem版本需要0.6。

您可以使用存储库中最新版本的 Twitter gem 来修复此问题。

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

关于ruby-on-rails - 我如何解决 Rails 3 (bundler) 中的 gem 依赖问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6559863/

相关文章:

ruby-on-rails - 白名单与设计

ruby-on-rails - 在另一个网站中嵌入用 Ruby on Rails 编码的网页?

ruby - 无法在 OSX 上安装 gem mysql

ruby-on-rails - 使用 rbenv 和多个项目随着时间的推移维护 gems

Bundler:bundle viz 是显示依赖关系的唯一方法吗?

ruby-on-rails - 路径名称与模块名称不同的 Rails 命名空间

ruby-on-rails - 有效地重命名 Rails 项目

ruby - 即使 gem 安装有效,Bundler 也找不到 gem

ruby - 为什么要求选择最新版本的 gem?

mysql - CENTOS 中的 REDMINE 安装(bundle/mysql 错误)