Gem file is requesting dependencies that are installed when upgrading from Rails 4 to Rails 5 but it says it could not find compatible versions
Asked Answered
M

2

7

This is my first major upgrade of Rails (v4 to v5). I've done minor upgrades, like 4.1.1 to 4.2 etc...

I've upgraded to 5.1.1, and I'm getting this dependency error in the console

Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    mail_form (= 1.7.0) was resolved to 1.7.0, which depends on
      actionmailer (< 5.2, >= 3.2)

    rails (>= 5.1.1, ~> 5.1) was resolved to 5.1.1, which depends on
      actionmailer (= 5.1.1)

however, I have actionmailer 5.1.1 installed. That looks like what it's asking for. These seems like an noob question, but it looks like rails MUST have actionmailer 5.1.1 and mail_form can have version less than 5.2 or equal/greater than 3.2. 5.1.1 satisfies both these conditions....so what's going on?

It also says this further down

Could not find gem 'rails (>= 5.1.1, ~> 5.1)' in any of the sources.

But I've uninstalled and reinstalled rails 5.1.1 to make sure.

I also tried doing this with 5.0.0 and had the same issue.

This is just one of many, many "Bundler could not find compatible versions for gem " errors in this bundle.

ruby '2.3.1'

source 'https://rubygems.org'

gem 'rails', '~> 5.1', '>= 5.1.1'

gem 'pg'
gem 'sass-rails', '~> 5.0', '>= 5.0.6'
gem 'uglifier', '>= 1.3.0'
gem 'yui-compressor'

# gem 'coffee-rails', '~> 4.1.0'
gem 'twitter-bootstrap-rails',  '= 3.2.2'
gem 'bootstrap-sass',  '>= 3.3.6'
gem 'draper', '= 3.0.1' 
gem 'jquery-rails', '~> 4.1', '>= 4.1.1'
gem "jquery-ui-rails"
gem 'sidekiq', '~> 4.2', '>= 4.2.2'
gem 'redis'
gem 'redis-namespace'
# gem 'turbolinks' 
gem 'jbuilder', '= 2.7.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'devise', '= 4.4.0'
gem 'omniauth', '~> 1.3', '>= 1.3.1'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2', '~> 0.3.0'
gem 'omniauth-twitter'
gem 'omniauth-eventbrite', '~> 0.0.6'
gem 'twitter' #for posting to twitter
gem 'koala' #for posting to facebook
gem 'sprockets-rails', '= 3.2.1'
gem 'sprockets', '~> 3.7', '>= 3.7.1'
gem 'geoip', '~> 1.6', '>= 1.6.1'
gem 'jsTimezoneDetect-rails'
gem 'simple_form'
# gem 'client_side_validations',  '= 4.2.12' #todo check validations NO RAILS 5
# gem 'client_side_validations-simple_form', '= 3.4.0'
gem 'acts_as_commentable'
gem 'attr_encrypted', '~> 3.0', '>= 3.0.3'
gem 'httparty', '~> 0.14.0'
gem "skylight"
gem 'braintree'
gem 'bitly', '~> 1.1', '>= 1.1.1'
# gem 'ahoy_email', '~> 0.2.3'
# gem 'compass-rails' #needed for chosen
# gem 'chosen-rails', '~> 1.5', '>= 1.5.2'
gem 'bootstrap-table-rails', '~> 1.11'
# gem 'chartjs-ror'
gem 'chartkick', '~> 2.2', '>= 2.2.3'
gem 'groupdate', '= 3.2.0'
gem 'hightop', '~> 0.2.0'
gem 'active_median', '~> 0.1.4'

gem 'bootstrap-tagsinput-rails'
gem 'faker'
gem 'slim'
# gem 'less-rails', '>= 2.8'
# gem 'less-rails', github: 'metaskills/less-rails', branch: 'depends_only_on_less_files'
# gem 'less-rails', git: 'https://github.com/Genkilabs/less-rails' #fix for deprecated Sprockets ImportProcessor
gem 'less-rails-bootstrap'
gem 'therubyracer'
gem 'american_date'
gem 'mail_form', '= 1.7.0'
# gem 'cancancan'
gem 'kaminari', '= 1.1.1'
gem 'bootstrap-kaminari-views', '~> 0.0.5'
gem 'aws-sdk', '~> 2'
gem 'carrierwave-aws'
gem 'carrierwave'
gem 'carrierwave-base64'
gem 'rmagick', '~> 2.16'
gem 'simple_form_fancy_uploads', '~> 0.2.0'
gem 'remotipart', '~> 1.2.1'
gem 'wysiwyg-rails', '=  2.7.3'
gem 'wicked'
gem 'meta-tags', '= 2.7.0'
gem 'acts-as-taggable-on', '~> 4.0'
gem 'acts_as_list', '~> 0.7.2'
gem 'factory_girl_rails'
gem 'friendly_id', '~> 5.1.0'
gem 'paranoia', '~> 2.2', '>= 2.2.1'
gem 'google-analytics-rails', '~> 1.1'
gem 'responders', '= 2.4.0'
gem 'cocoon', '~> 1.2', '>= 1.2.9'
gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.42'
gem 'tzinfo', '~> 1.2', '>= 1.2.3'
gem 'tzinfo-data'
# gem 'temporal-rails', '~> 0.2.4' #railties dependency
gem 'geocoder', '~> 1.3', '>= 1.3.1'
gem 'timezone', '~> 1.1'
gem 'browser'
gem 'jquery-datatables-rails', '~> 3.4'
gem 'hashie', '~> 3.4', '>= 3.4.4'
# Sinatra - might be required for the Sidekiq web UI?
gem 'sinatra', '~> 1.2'

gem 'paypal-sdk-permissions'
gem 'paypal-sdk-rest' #maybe use



# gem 'paypal-sdk-invoice'
# gem 'resque', '~> 1.26'
# gem 'resque-scheduler', '~> 4.1'
# gem 'active_scheduler', '~> 0.0.3'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'gon', '~> 6.0', '>= 6.0.1'

gem 'puma'
gem 'rack-timeout'
gem 'rest-client'
gem 'airbrake', '~> 5.6', '>= 5.6.1'
# gem 'rack-cache', '~> 1.6', '>= 1.6.1'
gem 'rack-attack', '~> 5.0', '>= 5.0.1'
gem 'rack-cors', '~> 0.4.0'
gem 'puma_worker_killer', '~> 0.0.7'
gem 'local-subdomain'
gem 'scout_apm'

gem 'concerned_with', '~> 0.1.0'
# gem 'elasticsearch-rails', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'
# gem 'elasticsearch-model', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'

gem 'pusher', '~> 1.3.1'

group :development do
  gem 'better_errors'
  # gem 'quiet_assets'
  gem 'foreman'
  gem 'guard-rspec', require: false
  # gem 'bullet', '~> 5.0'
  gem 'rake', '~> 11.1', '>= 11.1.1'
  gem 'web-console', '>= 2.3.0'
  # gem 'derailed_benchmarks', '~> 1.3', '>= 1.3.1'
  # gem 'rack-mini-profiler', '~> 0.10.1'

end


group :development, :test do
  gem 'rspec-rails','= 3.7.2'
  gem 'byebug'
  gem 'spring'
  gem 'spring-commands-rspec'
  gem 'mailcatcher', '~> 0.6.4'
  gem 'capybara', '~> 2.7', '>= 2.7.1'
  gem 'capybara-screenshot', '~> 1.0', '>= 1.0.13'
  gem 'database_cleaner'
  gem "email_spec"
  gem 'shoulda-matchers'
  gem 'rspec-activejob'
  gem 'awesome_print'
  gem 'lol_dba', '~> 2.1', '>= 2.1.1'
  gem 'rb-readline'
# gem 'invoice_samples', :git => "https://github.com/paypal/invoice-sdk-ruby.git"

end

group :test do
  gem 'poltergeist'
  gem 'selenium-webdriver'
  gem 'launchy'
  gem 'db-query-matchers'
  gem 'timecop'
  gem 'codeclimate-test-reporter'
  gem 'webmock', '~> 2.1'
end

group :production do
  gem 'rails_12factor'
  gem 'newrelic_rpm'
  gem 'keen'
end
Manualmanubrium answered 18/1, 2018 at 22:31 Comment(13)
which version of bundler are you using? Can you post your gemfile please?Rocketry
To follow on from @Rocketry … have you run gem update --system to get the latest gem system? Which version of ruby are you running on (ruby -v)? Are you using a ruby manager like RVM? If so, have you updated it recently?Sinnard
ruby -v is 2.3.1p112 bundler is 1.16.1 gem update --system: yesManualmanubrium
can you try clearing out your lock file and try againOrthogenic
yes, Gemfile.lock has been deleted this whole process. @OrthogenicManualmanubrium
can you post your Gemfile here?Orthogenic
done @Orthogenic added aboveManualmanubrium
sometimes, I have to remove the current gemlock file and bundle install afreshDeville
@Manualmanubrium what happens if you just go with one version of rails just specify rails 5.1 or rails 5.1.1 and try to resolve dependencies for that specific versionOrthogenic
I will try that again @subash. Is there a better way to write it than = 5.1.1 --that's how I was writing it beforeManualmanubrium
@Manualmanubrium I'm not sure if you even need that = if you are specifying just one version, I've never used thatOrthogenic
@Orthogenic I removed them, but nothing. The errors say things like this rails (= 5.1.1) was resolved to 5.1.1, which depends on activerecord (= 5.1.1) so I was "resolving" them in cased that helped.Manualmanubrium
What happens when you remove the rails version completely? After that try running rvm get stable and gem pristine --allRocketry
M
4

I ended up rebuilding the gem file line by line starting with just rails and pg and then pasting and bundle installing each new line.

I found I was hanging on "Sinatra".

None of the errors I found in bundling the complete gem file appeared in the line-by-line bundle. Sigh.

Manualmanubrium answered 23/1, 2018 at 20:35 Comment(0)
B
2

Before you bundle install, are you making sure to have RVM set to the ruby version you need (rvm use 2.3.1p112)?

You might also try bundle update before install and see if that helps.

Brawley answered 18/1, 2018 at 23:38 Comment(1)
No, that's how I get the errors. By running bundle updateManualmanubrium

© 2022 - 2024 — McMap. All rights reserved.