【发布时间】:2025-12-25 15:05:16
【问题描述】:
当我尝试时
bundle install
我得到错误:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
spree_bitpay (>= 0) ruby depends on
spree_auth_devise (>= 0) ruby depends on
devise (~> 2.0.4) ruby depends on
railties (~> 3.1) ruby
spree_bitpay (>= 0) ruby depends on
rails (= 4.0.9) ruby depends on
railties (4.0.9)
我尝试了我的 Gemfile 的 2 个版本,一个是标准 Gemfile 加上 bitpay 行,一个是我将所有其他 gem 注释掉,只有 bitpay 行,两者都不起作用。
宝石文件:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.9'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'
# 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', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'spree_bitpay', :git => 'https://github.com/bitpay/spree-bitpay.git'
我是 Ruby 和 Gemfiles 等的新手。谢谢 =)
做'gem list'我可以看到我有两个必需的版本: railties (4.1.8, 4.0.12, 4.0.9, 3.1.0)
【问题讨论】:
-
删除
Gemfile中需要的版本,只留下gem 'rails'并再次运行bundle install -
错误仍然显示:Bundler 找不到 gem "railties" 的兼容版本:在 Gemfile:spree_bitpay (>= 0) ruby 依赖于 spree_auth_devise (>= 0) ruby 依赖于 devise (~> 2.0 .4) ruby 依赖于 railties (~> 3.1) ruby spree_bitpay (>= 0) ruby 依赖于 rails (= 4.0.9) ruby 依赖于 railties (4.0.9)
-
您是否已经尝试过运行
bundle update? -
是:包更新更新github.com/bitpay/spree-bitpay.git 正在从rubygems.org 获取gem 元数据............正在从rubygems.org 获取其他元数据.. 解决依赖关系... Bundler 找不到gem "railties" 的兼容版本:在 Gemfile 中:spree_bitpay (>= 0) ruby 依赖于 spree_auth_devise (>= 0) ruby 依赖于 devise (~> 2.0.4) ruby 依赖于 railties (~> 3.1) ruby spree_bitpay (> = 0) ruby 依赖于 rails (= 4.0.9) ruby 依赖于 railties (4.0.9)
-
spree_bitpay 依赖于 rails 3.1 - 3.2。你暂时不能使用 rails 4.x。
标签: ruby-on-rails ruby spree