issue updating squeel with active admin, polyamorous, activerecord - ruby-on-rails

I've got a project that is a couple of years old (rails 4) that I'm trying to update (all for the sake of active admin's datetime select not working) -- when I comment out the need to update squeel it all updates fine; but if I uncomment out squeel so that it too updates I get these dependency issues:
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
acts-as-taggable-on was resolved to 4.0.0, which depends on
activerecord (>= 4.0)
annotate was resolved to 2.7.1, which depends on
activerecord (< 6.0, >= 3.2)
friendly_id (~> 5.1.0) was resolved to 5.1.0, which depends on
activerecord (>= 4.0.0)
pg_search was resolved to 1.0.6, which depends on
activerecord (>= 3.1)
polyamorous was resolved to 1.3.1, which depends on
activerecord (>= 3.0)
polyamorous was resolved to 1.3.1, which depends on
activerecord (>= 3.0)
rails (~> 4.2.1) was resolved to 4.2.1, which depends on
activerecord (= 4.2.1)
rails-erd was resolved to 1.4.7, which depends on
activerecord (>= 3.2)
random_record was resolved to 0.0.8, which depends on
activerecord (>= 3.0.0)
squeel was resolved to 0.5.0, which depends on
activerecord (~> 3.1.0.alpha)
Bundler could not find compatible versions for gem "polyamorous":
In Gemfile:
polyamorous
ransack was resolved to 1.8.1, which depends on
polyamorous (~> 1.3)
squeel was resolved to 0.8.10, which depends on
polyamorous (~> 0.5.0)
Bundler could not find compatible versions for gem "sass":
In Gemfile:
bootstrap-sass (~> 3.1.1) was resolved to 3.1.1.1, which depends on
sass (~> 3.2)
activeadmin was resolved to 1.0.0.pre4, which depends on
bourbon was resolved to 4.0.0, which depends on
sass (~> 3.3)
sass-rails (~> 4.0.1) was resolved to 4.0.5, which depends on
sass (~> 3.2.2)
I've tried a few different combinations of active admin such as:
# gem 'activeadmin', '~> 1.0.0.pre2'
# gem 'activeadmin', github: 'activeadmin'
gem 'activeadmin', github: 'gregbell/active_admin'
or
# gem 'ransack', github: 'ernie/ransack'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'formtastic', github: 'justinfrench/formtastic'
gem 'chosen-rails'
gem 'select2-rails'
gem 'active_admin_datetimepicker'
gem "active_admin-sortable_tree"
gem 'polyamorous', github: 'activerecord-hackery/polyamorous'
gem 'ransack', github: 'activerecord-hackery/ransack'
and
# gem "squeel" # Last officially released gem
# gem 'squeel', github: 'activerecord-hackery/squeel'
# gem "squeel", :git => "git://github.com/ernie/squeel.git" # Track git repo
But nothing seems to be working....

While I'm still at it (Rails 5 upgrade) you might want to try adding activeresource to your Gemfile explicitly. Like so:
gem 'activeresource', github: 'rails/activeresource'
gem 'activeadmin', github: 'activeadmin'
gem 'devise', '~> 3.4.1'
The update did work for me, at least so far, and without using additional dependencies such as ransack, draper etc. even though it is recommended to on their (ActiveAdmin's) official README.
Give it a try.

Related

bundle install gives me a lot of gems version errors

when I run bundle install I got this long error
bundle install
Fetching gem metadata from https://rails-assets.org/...
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......................
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
mail_form was resolved to 1.7.1, which depends on
actionmailer (>= 3.2, < 6)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
actionmailer (= 4.2.11.1)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
activeadmin was resolved to 1.4.3, which depends on
formtastic (~> 3.1) was resolved to 3.1.5, which depends on
actionpack (>= 3.2.13)
activeadmin was resolved to 1.4.3, which depends on
inherited_resources (>= 1.9.0) was resolved to 1.9.0, which depends on
has_scope (~> 0.6) was resolved to 0.7.2, which depends on
actionpack (>= 4.1)
activeadmin was resolved to 1.4.3, which depends on
inherited_resources (>= 1.9.0) was resolved to 1.9.0, which depends on
actionpack (>= 4.2, < 5.3)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
actionpack (= 4.2.11.1)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
actionpack (>= 3.0, < 5.2)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
mail_form was resolved to 1.7.1, which depends on
activemodel (>= 3.2, < 6)
paperclip (~> 4.3.1) was resolved to 4.3.7, which depends on
activemodel (>= 3.2.0)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
activemodel (= 4.2.11.1)
web-console (~> 2.0) was resolved to 2.3.0, which depends on
activemodel (>= 4.0)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
friendly_id (~> 5.4.0) was resolved to 5.4.2, which depends on
activerecord (>= 4.0.0)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
activerecord (= 4.2.11.1)
rails-erd was resolved to 1.6.1, which depends on
activerecord (>= 4.2)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
activerecord (>= 3.0, < 5.2)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activeadmin was resolved to 1.4.3, which depends on
arbre (>= 1.1.1) was resolved to 1.4.0, which depends on
activesupport (>= 3.0.0, < 6.2)
jbuilder (~> 2.0) was resolved to 2.9.1, which depends on
activesupport (>= 4.2.0)
activeadmin was resolved to 1.4.3, which depends on
kaminari (>= 0.15) was resolved to 1.2.1, which depends on
activesupport (>= 4.1.0)
paperclip (~> 4.3.1) was resolved to 4.3.7, which depends on
activesupport (>= 3.2.0)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
activesupport (= 4.2.11.1)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
activesupport (>= 3.0, < 5.2)
Bundler could not find compatible versions for gem "coffee-rails":
In Gemfile:
coffee-rails (~> 4.1.0)
activeadmin was resolved to 1.4.3, which depends on
coffee-rails
Bundler could not find compatible versions for gem "i18n":
In Gemfile:
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
activesupport (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
i18n (~> 0.7)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
i18n
Bundler could not find compatible versions for gem "json":
In Gemfile:
recaptcha was resolved to 5.8.1, which depends on
json
sdoc (~> 0.4.0) was resolved to 0.4.2, which depends on
json (~> 1.7, >= 1.7.7)
Bundler could not find compatible versions for gem "mimemagic":
In Gemfile:
paperclip (~> 4.3.1) was resolved to 4.3.7, which depends on
mimemagic (= 0.3.0)
Could not find gem 'mimemagic (= 0.3.0)', which is required by gem 'paperclip
(~> 4.3.1)', in any of the sources.
Bundler could not find compatible versions for gem "paperclip":
In Gemfile:
paperclip (~> 4.3.1)
paperclip-ffmpeg (~> 1.2.0) was resolved to 1.2.0, which depends on
paperclip (>= 2.5.2)
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
actionpack (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
rack (~> 1.6)
omniauth-google-oauth2 was resolved to 1.0.0, which depends on
oauth2 (~> 1.1) was resolved to 1.4.7, which depends on
rack (>= 1.2, < 3)
omniauth-google-oauth2 was resolved to 1.0.0, which depends on
omniauth (~> 2.0) was resolved to 2.0.4, which depends on
rack (>= 1.6.2, < 3)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
sprockets (>= 2.8, < 4.0) was resolved to 3.7.2, which depends on
rack (> 1, < 3)
devise was resolved to 4.8.0, which depends on
warden (~> 1.2.3) was resolved to 1.2.7, which depends on
rack (>= 1.0)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 4.2.11.1)
paperclip-ffmpeg (~> 1.2.0) was resolved to 1.2.0, which depends on
rails
Bundler could not find compatible versions for gem "railties":
In Gemfile:
activeadmin was resolved to 1.4.3, which depends on
railties (>= 4.2, < 5.3)
coffee-rails (~> 4.1.0) was resolved to 4.1.1, which depends on
railties (>= 4.0.0, < 5.1.x)
devise was resolved to 4.8.0, which depends on
railties (>= 4.1.0)
activeadmin was resolved to 1.4.3, which depends on
jquery-rails (>= 4.2.0) was resolved to 4.4.0, which depends on
railties (>= 4.2.0)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
railties (= 4.2.11.1)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
railties (>= 4.0.0, < 6)
web-console (~> 2.0) was resolved to 2.3.0, which depends on
railties (>= 4.0)
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
activeadmin was resolved to 1.4.3, which depends on
sprockets (< 4.1)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
sprockets (>= 2.8, < 4.0)
Bundler could not find compatible versions for gem "thor":
In Gemfile:
thor (= 0.19.1)
activeadmin was resolved to 1.4.3, which depends on
jquery-rails (>= 4.2.0) was resolved to 4.4.0, which depends on
thor (>= 0.14, < 2.0)
rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
railties (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
thor (>= 0.18.1, < 2.0)
Here is my gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.11.1'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.20.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'devise'
group :development, :test do
gem "interactive_editor"
gem "hirb"
gem "awesome_print"
gem 'byebug'
end
group :production do
gem 'rails_12factor'
gem 'puma'
end
gem 'mail_form'
gem 'font-awesome-sass', '~> 5.12.0'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootstrap-sass', '~>3.2.0'
gem 'paperclip', '~> 4.3.1'
gem 'aws-sdk-s3'
gem 'aws-sdk', '< 2.0'
gem 'thor', '0.19.1'
gem 'omniauth-google-oauth2'
gem "recaptcha", require: "recaptcha/rails"
gem 'friendly_id', '~> 5.4.0'
gem 'activeadmin'
gem 'rails-assets-sweetalert2', source: 'https://rails-assets.org'
gem 'sweet-alert2-rails'
gem 'sweet-alert-confirm'
gem 'cocoon'
gem 'bigdecimal', '1.3.5'
gem 'paperclip-av-transcoder'
gem "paperclip-ffmpeg", "~> 1.2.0"
gem "will_paginate", "~> 3.0.4"
gem 'rails-erd'
gem 'bundler', '1.17.3'
How can I fix it?
This error came after I changed the bundle version
It is as the error message says. The versions you specify in the gem file is not available. This happens because each bundle version only supports down to a certain version, for example it can download any version from 2 and up but version 1 is not available. I see your gems are outdated, and you should consider to just update them. Unless you have done something version specific you should not need these restrictions anymore for rails version 4.2. If not you have to roll back your bundle version.
The error is mimemagic, required by paperclip.
You'll have to upgrade or provide the mimemagic gem from source.
This happened to me and had to obtain the code from an old project in order to supply it.
For reference:
https://github.com/rails/rails/issues/41750

Rails 5.2.3 to 6.0.0 upgrade dependency hell

I ran bundle update rails to update my app to 6.0, and got this very confusing output. Updating these gems in the gemfile does not have any impact. I can't make heads or tails of this error, and it feels like a catch 22. This is the output:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
activerecord-session_store (~> 1.1, >= 1.1.3) was resolved to 1.1.3, which depends on
actionpack (>= 4.0)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
formtastic (~> 3.1) was resolved to 3.1.5, which depends on
actionpack (>= 3.2.13)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
inherited_resources (>= 1.9.0) was resolved to 1.11.0, which depends on
has_scope (~> 0.6) was resolved to 0.7.2, which depends on
actionpack (>= 4.1)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
inherited_resources (>= 1.9.0) was resolved to 1.11.0, which depends on
actionpack (>= 5.0, < 6.1)
rails (= 6.0.0) was resolved to 6.0.0, which depends on
actionpack (= 6.0.0)
devise (~> 4.2) was resolved to 4.7.1, which depends on
responders was resolved to 3.0.0, which depends on
actionpack (>= 5.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
carrierwave (~> 2.0, >= 2.0.2) was resolved to 2.0.2, which depends on
activemodel (>= 5.0.0)
rails (= 6.0.0) was resolved to 6.0.0, which depends on
activemodel (= 6.0.0)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
activerecord-session_store (~> 1.1, >= 1.1.3) was resolved to 1.1.3, which depends on
activerecord (>= 4.0)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
kaminari (>= 0.15) was resolved to 1.1.1, which depends on
kaminari-activerecord (= 1.1.1) was resolved to 1.1.1, which depends on
activerecord
rails (= 6.0.0) was resolved to 6.0.0, which depends on
activerecord (= 6.0.0)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 2.3.0, which depends on
activerecord (>= 5.0)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
bullet (~> 6.1) was resolved to 6.1.0, which depends on
activesupport (>= 3.0.0)
carrierwave (~> 2.0, >= 2.0.2) was resolved to 2.0.2, which depends on
activesupport (>= 5.0.0)
jbuilder (~> 2.0) was resolved to 2.9.1, which depends on
activesupport (>= 4.2.0)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
kaminari (>= 0.15) was resolved to 1.1.1, which depends on
activesupport (>= 4.1.0)
rails (= 6.0.0) was resolved to 6.0.0, which depends on
activesupport (= 6.0.0)
stripe_event (~> 2.3) was resolved to 2.3.0, which depends on
activesupport (>= 3.1)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 6.0.0)
invisible_captcha (~> 1.0) was resolved to 1.0.0, which depends on
rails (>= 4.2)
mini_backtrace (= 0.1.3) was resolved to 0.1.3, which depends on
rails (>= 2.3.3)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
railties (>= 4.2, < 5.3)
activerecord-session_store (~> 1.1, >= 1.1.3) was resolved to 1.1.3, which depends on
railties (>= 4.0)
devise (~> 4.2) was resolved to 4.7.1, which depends on
railties (>= 4.1.0)
factory_bot_rails (~> 4.8, >= 4.8.2) was resolved to 4.11.1, which depends on
railties (>= 3.0.0)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
inherited_resources (>= 1.9.0) was resolved to 1.11.0, which depends on
railties (>= 5.0, < 6.1)
activeadmin (~> 1.4.3) was resolved to 1.4.3, which depends on
jquery-rails (>= 4.2.0) was resolved to 4.3.5, which depends on
railties (>= 4.2.0)
rails (= 6.0.0) was resolved to 6.0.0, which depends on
railties (= 6.0.0)
sass-rails (~> 5.0.6) was resolved to 5.0.7, which depends on
railties (>= 4.0.0, < 6)
web-console (~> 3.0) was resolved to 3.7.0, which depends on
railties (>= 5.0)
My Gemfile looks like this:
source 'https://rubygems.org'
ruby '2.5.0'
gem 'rails', '6.0.0'
gem 'pg', '~> 0.18.3'
gem 'iodine', '~> 0.7.38'
gem 'sass-rails', '~> 5.0.6'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails'
gem 'therubyracer', '~> 0.12.3'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'figaro', '~> 1.1', '>= 1.1.1'
gem 'less-rails', '~> 4.0.0'
gem 'autoprefixer-rails'
gem 'devise', '~> 4.2'
gem 'mini_magick', '~> 4.5', '>= 4.5.1'
gem 'carrierwave', '~> 2.0', '>= 2.0.2'
gem 'fog-aws', '~> 3.5', '>= 3.5.2'
gem 'aws-sdk', '~> 2'
gem 'activeadmin', '~> 1.4.3'
gem 'friendly_id', '~> 5.1'
gem 'pagy', '~> 3.7', '>= 3.7.2'
gem 'activerecord-session_store', '~> 1.1', '>= 1.1.3'
gem 'sprockets', '3.7.2'
gem 'aasm', '~> 5.0'
gem 'redis', '~> 4.1', '>= 4.1.3'
gem 'sidekiq', '~> 6.0', '>= 6.0.4'
gem 'local_time', '~> 2.1'
gem 'stripe', '~> 5.11'
gem 'stripe_event', '~> 2.3'
gem 'lockbox', '~> 0.2.4'
gem 'mailgunner', '~> 2.4'
gem 'rack-attack'
gem 'invisible_captcha', '~> 1.0'
group :development do
gem 'web-console', '~> 3.0'
gem 'letter_opener', '~> 1.7'
gem 'bullet', '~> 6.1'
end
group :development, :test do
gem 'byebug'
gem 'spring'
gem 'spring-commands-rspec'
gem 'factory_bot_rails', '~> 4.8', '>= 4.8.2'
gem 'faker', '~> 1.6', '>= 1.6.6'
gem 'minitest', '~> 5.8', '>= 5.8.4'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
gem 'database_cleaner', '~> 1.7'
end
group :production do
gem 'newrelic_rpm'
end
What does the error mean? Where do I start? Do I do bundle update first, and then bundle update rails? Or vice versa? This is like battling a hydra.
I managed to get past this error by adding the following to my Gemfile
gem 'sassc', '~> 2.1.0'
After that, running bundle install returned this:
You have requested:
sassc ~> 2.1.0
The bundle currently has sassc locked at 2.4.0.
Try running `bundle update sassc`
...so I ran bundle update sassc and then bundle install. Everything seems to have updated normally, so far at least.
This is apparently a known issue with sassc, mentioned here and here.
However, my bundler was getting stuck on the sassc update. Hopefully someone else can provide more insight on the other gems

Rails 5 upgrade error - Bundler could not find compatible versions for gem "actionpack":

I have been stuck on these errors all day without any resolution. I am hoping someone could help me on this site. I have read numerous similar questions on this website and online, but none seem to work. I am trying to upgrade my rails from 4.2.2 to 5.1.6. However, I continue to get the following error every time I run bundle install.
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
active_model_serializers (= 0.10.9) was resolved to 0.10.9, which depends on
actionpack (< 6, >= 4.1)
axlsx_rails (= 0.5.2) was resolved to 0.5.2, which depends on
actionpack (>= 3.1)
rails (= 5.1.6) was resolved to 5.1.6, which depends on
actionpack (= 5.1.6)
responders (~> 2.0) was resolved to 2.4.1, which depends on
actionpack (< 6.0, >= 4.2.0)
Bundler could not find compatible versions for gem "actionview":
In Gemfile:
rails (= 5.1.6) was resolved to 5.1.6, which depends on
actionview (= 5.1.6)
web-console (= 3.5.1) was resolved to 3.5.1, which depends on
actionview (>= 5.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
active_model_serializers (= 0.10.9) was resolved to 0.10.9, which depends on
activemodel (< 6, >= 4.1)
carrierwave (= 1.2.2) was resolved to 1.2.2, which depends on
activemodel (>= 4.0.0)
rails (= 5.1.6) was resolved to 5.1.6, which depends on
activemodel (= 5.1.6)
web-console (= 3.5.1) was resolved to 3.5.1, which depends on
activemodel (>= 5.0)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
carrierwave (= 1.2.2) was resolved to 1.2.2, which depends on
activesupport (>= 4.0.0)
jbuilder (= 2.7.0) was resolved to 2.7.0, which depends on
activesupport (>= 4.2.0)
rails (= 5.1.6) was resolved to 5.1.6, which depends on
activesupport (= 5.1.6)
spring (= 2.0.2) was resolved to 2.0.2, which depends on
activesupport (>= 4.2)
Bundler could not find compatible versions for gem "json":
In Gemfile:
fog (= 1.42) was resolved to 1.42.0, which depends on
json (~> 2.0)
sdoc (= 0.4.0) was resolved to 0.4.0, which depends on
json (~> 1.8)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 5.1.6)
mini_backtrace (= 0.1.3) was resolved to 0.1.3, which depends on
rails (>= 2.3.3)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails (= 4.2.2) was resolved to 4.2.2, which depends on
railties (>= 4.0.0)
jquery-rails (= 4.3.1) was resolved to 4.3.1, which depends on
railties (>= 4.2.0)
rails (= 5.1.6) was resolved to 5.1.6, which depends on
railties (= 5.1.6)
responders (~> 2.0) was resolved to 2.4.1, which depends on
railties (< 6.0, >= 4.2.0)
sass-rails (= 5.0.6) was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
web-console (= 3.5.1) was resolved to 3.5.1, which depends on
railties (>= 5.0)
I have tried to update all of the gems it gives an error on to the latest version, but that does not seem to help. I have also deleted the gem.lock file which didn't help.
My gem file is:
source 'https://rubygems.org'
ruby '2.4.5'
gem 'rails', '5.1.6'
gem 'bcrypt', '3.1.12'
gem 'faker', '1.7.3'
gem 'carrierwave', '1.2.2'
gem 'mini_magick', '4.7.0'
gem 'fog', '1.42'
gem 'will_paginate', '3.1.6'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'bootstrap-sass', '3.3.7'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.7.0'
gem 'sdoc', '0.4.0', group: :doc
gem 'axlsx', '2.0.1'
gem 'axlsx_rails', '0.5.2'
gem 'prawn'
gem 'prawn-table'
gem 'aws-sdk', '~> 2'
gem 'multipart-post'
#api gems
gem 'active_model_serializers', '0.10.9'
gem 'responders', '~> 2.0'
gem "recaptcha", require: "recaptcha/rails"
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '9.0.6', platform: :mri
gem 'web-console', '3.5.1'
gem 'listen', '3.1.5'
gem 'spring', '2.0.2'
gem 'spring-watcher-listen', '2.0.1'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
gem 'puma', '3.9.1'
end
Any help would be greatly appreciated! I have lost the good part of today trying to figure this out!

RAILS 5: Bundler could not find compatible versions for gem “actionpack”:

Could anyone please help me for upgrading the rails 4.2 to rails 5.1.4
after run the bundle update got the compatible versions error
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
active_link_to (~> 1.0.0) was resolved to 1.0.5, which depends on
actionpack
active_model_serializers (~> 0.10.6) was resolved to 0.10.7, which depends on
actionpack (< 6, >= 4.1)
hamlit-rails (~> 0.2.0) was resolved to 0.2.0, which depends on
actionpack (>= 4.0.1)
meta-tags (~> 2.4.1) was resolved to 2.4.1, which depends on
actionpack (< 5.2, >= 3.2.0)
rails (~> 5.1.4) was resolved to 5.1.4, which depends on
actionpack (= 5.1.4)
ransack (~> 1.6.6) was resolved to 1.6.6, which depends on
actionpack (>= 3.0)
rspec-rails (~> 3.4.2) was resolved to 3.4.2, which depends on
actionpack (< 4.3, >= 3.0)
simple_form (~> 3.5.1) was resolved to 3.5.1, which depends on
actionpack (< 5.2, > 4)
stream_rails (>= 2.5.2, ~> 2.5) was resolved to 2.6.1, which depends on
actionpack (>= 3.0.0)
twitter-typeahead-rails (~> 0.10.5) was resolved to 0.10.5, which depends on
actionpack (>= 3.1)
your rspec-rails blocks the upgrade. That bundler output shows this part:
actionpack (< 4.3, >= 3.0)
So rspec-rails blocks anything bigger that 4.2.
Release the rspec-rails contraint ~> 3.4.2 to something more relaxed like ~> 3.5 and try again
bundle update rails rspec-rails
In general, when upgrading Rails, try bundle update rails together with all the Gems that have specific version requirements for Rails or that are mentioned from bundler.
That happened to me when I was trying to update to rails 6. here is my workaround.
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
gem 'rails', '6.0.0.rc1'
gem 'sqlite3'
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
gem 'activerecord-import'
gem 'bootsnap'
gem "rspec"
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
platforms :rbx do
gem 'rubysl', '~> 2.0'
gem 'rubinius-developer_tools'
end
Remove your Gemfile.lock and add this to your Gemfile:
source 'https://rubygems.org'
and don't forget to update your other gems.
I have faced this issue when I used these gems with versions:
gem 'rspec-rails', '~> 3.4.2'
gem 'factory_girl_rails', '~> 4.7.0'
It worked for me after removing gem version from specified gem.
gem 'rspec-rails'
gem 'factory_girl_rails'

Could not find compatible versions for gem "spree_core"

I've just ran through the 'Getting Started' guide from Spree commerce and I've hit an error while following it.
I've run the following commands:
gem install spree_cmd
bundle install
Then I get hit with the following errors in the console
Bundler could not find compatible versions for gem "spree_core":
In Gemfile:
spree_auth_devise (~> 3.0.0) was resolved to 3.0.5, which depends on
spree_core (~> 3.0.0)
spree (~> 3.1.0) was resolved to 3.1.0, which depends on
spree_backend (= 3.1.0) was resolved to 3.1.0, which depends on
spree_core (= 3.1.0)
spree (~> 3.1.0) was resolved to 3.1.0, which depends on
spree_backend (= 3.1.0) was resolved to 3.1.0, which depends on
spree_core (= 3.1.0)
spree (~> 3.1.0) was resolved to 3.1.0, which depends on
spree_backend (= 3.1.0) was resolved to 3.1.0, which depends on
spree_core (= 3.1.0)
spree (~> 3.1.0) was resolved to 3.1.0, which depends on
spree_backend (= 3.1.0) was resolved to 3.1.0, which depends on
spree_core (= 3.1.0)
spree (~> 3.1.0) was resolved to 3.1.0, which depends on
spree_backend (= 3.1.0) was resolved to 3.1.0, which depends on
spree_core (= 3.1.0)
Which looks like it all checks out - but it seems to be failing to bundle install.
My Gemfile
gem 'spree', '~> 3.1.0'
gem 'spree_gateway', '~> 3.0.0'
gem 'spree_auth_devise', '~> 3.0.0'
Any help would be brilliant
You same versions for all 3 extensions/gems.
Either, (for Spree 3.1.x)
gem 'spree', '~> 3.1.0'
gem 'spree_gateway', '~> 3.1.0'
gem 'spree_auth_devise', '~> 3.1.0'
Or, (for Spree 3.0.x)
gem 'spree', '~> 3.0.0'
gem 'spree_gateway', '~> 3.0.0'
gem 'spree_auth_devise', '~> 3.0.0'

Resources