简体   繁体   中英

Bundler could not find compatible versions for gem spree_core (Spree Ruby on Rails)

I just configured Spree on Rails successfully (on Rails 4.0.2 + Ruby 2.0.0 as well as on Rails 3.2.4 + Ruby 1.9.3) but now I am trying to add "spree_marketplace" and "spree_drop_ship" to spree but getting this error

Bundler could not find compatible versions for gem "spree_core":
  In Gemfile:
    spree_marketplace (>= 0) ruby depends on
      spree_core (~> 2.0.3) ruby

    spree (>= 0) ruby depends on
      spree_core (2.2.0.beta)

Currently my Ruby and Rails versions are

$ ruby -v
ruby 2.0.0p353

$ rails -v
Rails 4.0.2

My Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

gem 'spree', :github => "spree/spree"
gem 'spree_auth_devise', :github => "spree/spree_auth_devise"
gem 'spree_marketplace', github: 'jdutil/spree_marketplace'
gem 'spree_drop_ship', github: 'jdutil/spree_drop_ship'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

You are being limited by spree_marketplace gemspec as @AlexD wrote. You can do two things, either use someone's fork (or create your own) with bumped gemspec (although such bumping can broke something, you must check it by yourself and run specs if they are written):

gem 'spree', :github => "spree/spree", branch: '2-1-stable'
gem 'spree_auth_devise', :github => "spree/spree_auth_devise", branch: '2-1-stable'
gem 'spree_marketplace', github: 'emcgee/spree_marketplace'
gem 'spree_drop_ship', github: 'jdutil/spree_drop_ship'

Or downgrade to maximum version allowed by spree_marketplace :

gem 'spree', :github => "spree/spree", branch: '2-0-stable'
gem 'spree_auth_devise', :github => "spree/spree_auth_devise", branch: '2-0-stable'
gem 'spree_marketplace', github: 'jdutil/spree_marketplace'
gem 'spree_drop_ship', github: 'jdutil/spree_drop_ship', branch: '2-0-stable'

If you want to use Rails 4 you should use Spree 2.1 AFAIK.

You need to specify the version of Spree you want to use in your Gemfile. The spree_marketplace gem which you want to use is good for versions of Spree in the 2.0 series, from 2.0.3 up to 2.0.7 (the last version lower than 2.1.0). Pick a version in that range, and specify that for the spree gem. Otherwise Bundler will think you want to use the most recent version of the spree gem.

Something like this:

gem 'spree', '2.0.7', :github => "spree/spree"

If you want to use the new 2.2.0 version of Spree, you'll have to either create an updated version of spree_marketplace yourself, or get someone else to do it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM