我使用ruby 2.4.2和rails 5.0.6(系统运行良好),我尝试升级到rails 5.1.4,我从gem' rails&改变了Gemfiles #39;,' 5.0.6'到gem' rails',' 5.1.4',并运行bundle update,
我的问题是,当我进行捆绑更新时,为什么 redis-namespace降级到版本0.4.3并且resque降级到版本1.8.2请参阅下面的跟踪控制台。
Using redis 4.0.1 (was 3.3.5)
Using redis-namespace 0.4.3 (was 1.5.3)
Using resque 1.8.2 (was 1.27.4)
这导致我无法运行rails服务器,谢谢。
的Gemfile
source 'https://rubygems.org'
gem 'rails', '5.1.4'
gem 'pg', '~> 0.19'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier'
# Use CoffeeScript for .js.coffee assets and views
# gem 'coffee-rails', '4.0.1'
gem 'coffee-rails', '~> 4.2'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-turbolinks'
# gem 'jquery-ui-rails', '~> 4.2.1' # please note 4.2.1 is the compatible one
gem 'jquery-ui-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', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', group: :doc
gem 'rake'
gem 'bootstrap-sass' # for twitter bootstrap
gem 'material_icons' # icon
gem 'sass-rails', '>= 3.2'
gem 'will_paginate'
gem 'ransack'
gem 'cancancan'
gem 'rmagick', require: false
gem 'carrierwave'
gem 'prawn'
gem 'prawn-table'
# resque
gem 'resque'
gem "sinatra", ">= 2.0.0.beta2", require: false
gem 'thor', '0.19.1'
# csv import
gem 'smarter_csv'
# redis action cable
gem "hiredis"
gem "redis"
# webserver
gem 'puma', '3.6.2'
Bundler could not find compatible versions for gem "redis":
In Gemfile:
redis (>= 4.0.1)
resque (~> 1.27.0) was resolved to 1.27.4, which depends on
redis-namespace (~> 1.3) was resolved to 1.3.1, which depends on
redis (~> 3.0.0)
答案 0 :(得分:1)
在做了另一个研究和另一个错误消息后我发现对于rails 5.x应该使用redis-rails而不是redis和我今天发现的另一个问题也是json(需要resque gem和sdoc),确保gem' json'与版本> = 2.1.0在Gemfile中列出,如果不是通常捆绑包将安装版本1.8.6(使用rails 5.x生成错误),所以对于我发现这2个错误,我将更新我的答案我找到了另一个
的Gemfile
gem "redis-rails"
gem 'json', '>= 2.1.0'
答案 1 :(得分:0)
这是将gem依赖项修复为补丁/次要版本的问题。
您应该只在Gemfile中尝试使用gem redis
,然后运行bundle update
。这应该解决问题。有些测试可能会破坏,特别是如果自redis旧版本以来redis的公共api已经更新。您可能需要找到更新的API才能使一切正常运行。