I am trying to update a Rails app from Rails 5.2.0.rc2 to Rails 5.2.2
So far, I:
Deleted gemfile.lock
Removed version numbers from most gems in the gem file
Upgraded version to 5.2.2 for the rails gem in the gem file
When I run bundle update or bundle install, I get this error:
Bundler could not find compatible versions for gem "railties": In Gemfile:
coffee-rails was resolved to 4.2.2, which depends on
railties (>= 4.0.0)
font-awesome5-rails was resolved to 1.0.1, which depends on
railties (< 5.2, >= 3.2)
jquery-rails was resolved to 4.3.3, which depends on
railties (>= 4.2.0)
rails (= 5.2.2) was resolved to 5.2.2, which depends on
railties (= 5.2.2)
rails-i18n was resolved to 5.1.3, which depends on
railties (< 6, >= 5.0)
sass-rails was resolved to 5.0.7, which depends on
railties (< 6, >= 4.0.0)
web-console was resolved to 3.7.0, which depends on
railties (>= 5.0)
If i try bundle update rails, I get:
This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.
Here is my Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '5.2.2'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.7.3'
gem 'mini_magick', '4.8'
gem 'nokogiri', '1.8.1'
gem 'will_paginate', '3.1.6'
gem 'will_paginate-bootstrap4'
gem 'bootstrap', '~> 4.2.1'
gem 'puma', '3.11'
gem 'sass-rails'
gem 'uglifier'
gem 'mini_racer', platforms: :ruby
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '2.7.0'
gem 'rails-i18n'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'cloudinary'
gem 'font-awesome5-rails'
gem 'pg', '0.20.0'
gem 'flatpickr'
gem 'delayed_job_active_record'
gem 'openpay'
group :development, :test do
gem 'byebug', '9.0.6', platform: :mri
end
group :development do
gem 'web-console'
gem 'listen'
gem 'spring'
gem 'spring-watcher-listen'
end
group :test do
gem 'rails-controller-testing'
gem 'minitest-reporters'
gem 'guard'
gem 'guard-minitest'
end
# group :production do
# gem 'pg', '0.20.0'
# end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Please help, thank you.
I solved it. I just added the railties gem to the Gemfile, just below the rails gem, i.e.:
gem 'rails', '5.2.2'
gem 'railties', '5.2.2' # added this line
I don't know why it wasn't there already. Hope this helps.
Related
Upgrading from Rails 4.2.8 to Rails 5.0.2 results in the error message below. I am not sure how to resolve the dependencies. The ruby version is 2.5.1. I've been able to run this app and the test suite with Rails 4.2.8, though I have seen some excessive printing by a lower version of carrierwave, so I'd like to be able to upgrade that, but it requires Rails 5.
Error Message
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
actionpack-action_caching was resolved to 1.2.0, which depends on
actionpack (< 6, >= 4.0.0)
rails (= 5.0.2) was resolved to 5.0.2, which depends on
actionpack (= 5.0.2)
simple_form was resolved to 4.1.0, which depends on
actionpack (>= 5.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
carrierwave was resolved to 2.0.0, which depends on
activemodel (>= 5.0.0)
rails (= 5.0.2) was resolved to 5.0.2, which depends on
activemodel (= 5.0.2)
simple_form was resolved to 4.1.0, which depends on
activemodel (>= 5.0)
validate_url was resolved to 1.0.8, which depends on
activemodel (>= 3.0.0)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
friendly_id (~> 5.1.0) was resolved to 5.1.0, which depends on
activerecord (>= 4.0.0)
rails (= 5.0.2) was resolved to 5.0.2, which depends on
activerecord (= 5.0.2)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
active_hash (~> 1.4.1) was resolved to 1.4.1, which depends on
activesupport (>= 2.2.2)
carrierwave was resolved to 2.0.0, which depends on
activesupport (>= 5.0.0)
rails (= 5.0.2) was resolved to 5.0.2, which depends on
activesupport (= 5.0.2)
Bundler could not find compatible versions for gem "http":
In Gemfile:
http
twitter (~> 5.15.0) was resolved to 5.15.0, which depends on
http (< 0.10, >= 0.4)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 5.0.2)
interactor-rails (~> 2.0) was resolved to 2.2.0, which depends on
rails (< 5.3, >= 4.2)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 5.0.2) was resolved to 5.0.2, which depends on
railties (= 5.0.2)
sass-rails (~> 5.0.1) was resolved to 5.0.8, which depends on
railties (>= 5.2.0)
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
sprockets
sass-rails (~> 5.0.1) was resolved to 5.0.8, which depends on
sprockets (< 4.0, >= 2.8)
Gemfile
source 'https://rubygems.org'
ruby '2.5.1'
gem 'actionpack-action_caching'
gem 'active_hash', '~> 1.4.1'
gem 'avatars.io'
gem 'aws-sdk-s3', '~> 1'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'carrierwave'
gem 'carrierwave_direct'
gem 'coffee-rails', '~> 4.0.0'
gem 'compass-rails', '~> 2.0.2'
gem 'dalli'
gem 'devise'
gem 'diffy'
gem 'font-awesome-rails'
gem 'fog'
gem 'foundation-rails', '~> 5.5.3.2'
gem 'friendly_id', '~> 5.1.0'
gem 'haml'
gem 'html5shiv-js-rails'
gem 'http'
gem 'interactor-rails', '~> 2.0'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'pg'
gem 'puma', '~> 3.11.4'
gem 'rails', '5.0.2'
gem 'redcarpet'
gem 'rmagick'
gem 'ruby-mp3info', '>= 0.8.4'
gem 'sass-rails', '~> 5.0.1'
gem 'sidekiq'
gem 'sinatra', require: false
gem 'simple_form'
gem 'sprockets'
gem 'stamp'
gem 'twitter', '~> 5.15.0'
gem 'uglifier', '>= 1.3.0'
gem 'validate_url'
gem 'xml-simple', '~> 1.1.5'
gem 'will_paginate'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'quiet_assets'
end
group :production do
gem 'rails_12factor'
gem 'scout_apm'
gem 'sentry-raven'
# gem 'unicorn-worker-killer'
end
group :test do
gem 'factory_girl_rails'
gem 'm'
gem 'minitest-rails', '~> 2.2.0'
gem 'simplecov', '~> 0.9', require: false
gem 'timecop'
end
group :development, :test do
gem 'dotenv-rails'
gem 'pry'
gem 'awesome_print'
end
sass-rails (~> 5.0.1) was resolved to 5.0.8, which depends on
railties (>= 5.2.0)
railties 5.2 will conflict with the rest of Rails at 5.0 - you need to restrict sass-rails to < 5.0.8
back up your gemfile first and then try with this
source 'https://rubygems.org'
ruby '2.5.1'
gem 'actionpack-action_caching'
gem 'active_hash'
gem 'avatars.io'
gem 'aws-sdk-s3'
gem 'bootstrap-sass'
gem 'carrierwave'
gem 'carrierwave_direct'
gem 'coffee-rails'
gem 'compass-rails'
gem 'dalli'
gem 'devise'
gem 'diffy'
gem 'font-awesome-rails'
gem 'fog'
gem 'foundation-rails'
gem 'friendly_id'
gem 'haml'
gem 'html5shiv-js-rails'
gem 'http'
gem 'interactor-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'pg'
gem 'puma'
gem 'rails'
gem 'redcarpet'
gem 'rmagick'
gem 'ruby-mp3info'
gem 'sass-rails'
gem 'sidekiq'
gem 'sinatra', require: false
gem 'simple_form'
gem 'sprockets'
gem 'stamp'
gem 'twitter'
gem 'uglifier'
gem 'validate_url'
gem 'xml-simple'
gem 'will_paginate'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'quiet_assets'
end
group :production do
gem 'rails_12factor'
gem 'scout_apm'
gem 'sentry-raven'
# gem 'unicorn-worker-killer'
end
group :test do
gem 'factory_girl_rails'
gem 'm'
gem 'minitest-rails'
gem 'simplecov', require: false
gem 'timecop'
end
group :development, :test do
gem 'dotenv-rails'
gem 'pry'
gem 'awesome_print'
end
run
bundle update
I am upgrading my rails app from rails 4 to rails 5.0.0
I have fixed most dependency issues except the following:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
actionpack
rails (= 5.0.0) was resolved to 5.0.0, which depends on
actionpack (= 5.0.0)
rails-controller-testing was resolved to 1.0.1, which depends on
actionpack (~> 5.x)
responders (~> 2.0) was resolved to 2.4.1, which depends on
actionpack (< 6.0, >= 4.2.0)
rspec-rails (~> 3.6) was resolved to 3.8.2, which depends on
actionpack (>= 3.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
activemodel
activeresource was resolved to 5.1.0, which depends on
activemodel (< 7, >= 5.0)
protected_attributes was resolved to 1.0.2, which depends on
activemodel (< 5.0, >= 4.0.0.beta)
rails (= 5.0.0) was resolved to 5.0.0, which depends on
activemodel (= 5.0.0)
I deleted the Gemfile.lock and did bundle install again.
I also did gem install actionpack and gem install activemodel
My Gemfile:
source 'https://rubygems.org'
ruby "2.3.8"
gem 'rails', '5.0.0'
gem 'actionpack' #, '~> 5.0.0'
gem 'activemodel'#, '~> 5.0.0'
gem 'bootstrap-sass', '3.1.1.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.0.1'
gem 'will_paginate', '~> 3.0.5'
gem 'bootstrap-will_paginate', '0.0.10'
# gem 'will_paginate-bootstrap'
gem 'aws-sdk', '~> 2'
gem 'aws-sdk-v1'
gem "jquery-fileupload-rails"
gem 'textacular', '~> 3.0'
# gem 'lazy_high_charts'
gem "highcharts-rails", "~> 3.0.0"
gem 'pivot_table'
gem 'bootstrap-table-rails'
gem 'newrelic_rpm'
gem 'resque', "~> 1.22.0", require: "resque/server"
gem 'resque_mailer'
gem 'holidays'
gem 'wicked_pdf'
gem 'puma'
gem 'rest-client'
gem 'mocha'
gem 'turbolinks', '~> 5.2.0'
#
# for api
gem 'jwt'
gem 'responders', '~> 2.0'
gem 'phantomjs', :require => 'phantomjs/poltergeist'
# for text notifications
gem 'twilio-ruby'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'pg','~> 0.18'
gem 'annotate'
gem 'letter_opener'
gem 'wkhtmltopdf-binary'
gem 'spring-commands-rspec'
end
group :test do
# gem 'pg'
gem 'sqlite3', '1.3.10'
gem 'rspec-rails', '~> 3.6'
gem 'rspec-its'
gem 'capybara', '~> 2.4.0'
gem 'poltergeist'
gem 'factory_bot_rails'
gem 'minitest'
gem 'test-unit'
gem 'shoulda-matchers'
gem 'rails-controller-testing'
gem 'shoulda-callback-matchers'
gem 'database_cleaner'
gem 'selenium-webdriver', '~>3.6.0'
end
gem 'sass-rails', '~> 4.0.2'
gem 'coffee-rails', '4.0.0'
gem 'uglifier', '1.3.0'
gem 'chosen-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
group :production do
gem 'pg','~> 0.18'
gem 'wkhtmltopdf-heroku'
end
gem 'rack-mini-profiler'
gem "bullet", :group => "development"
# Rails 4 Transition
gem 'protected_attributes'
gem 'activeresource'
I am attempting to update my app to Rails 5.0.1. After attempting to run bundle update, the error below appears, but there is no rack gem.
How can I get this to resolve?
Error:
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
rack (~> 2.0)
rails (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) x86-mingw32 was resolved to 5.0.1, which depends on
rack (~> 2.0) x86-mingw32
sprockets (= 2.11.3) was resolved to 2.11.3, which depends on
rack (~> 1.0)
sprockets (= 2.11.3) was resolved to 2.11.3, which depends on
rack (~> 1.0) x86-mingw32
gemfile:
source 'http://rubygems.org'
ruby '2.4.0' # '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '5.0.1'#'4.2.6'
#gem 'pg', '0.15.1'
gem 'mysql2', '0.4.5'#'0.4.4'
gem 'bootstrap-sass', '2.3.2.0'#'3.3.6'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'geocoder', '1.3.7'
gem 'nested_form', '0.3.2'
gem 'utf8-cleaner', '0.2.4'
gem 'sprockets', '2.11.3' #2.11.3
gem 'json', '1.8.6'#'1.8.3'
gem 'ffi'
gem 'iconv', '1.0.4'
gem 'chosen-rails', '1.5.2'
gem 'compass-rails', github: 'Compass/compass-rails'
# For image uploads
gem 'carrierwave', '0.11.2'
# For uploading CSV
gem 'roo', '2.4.0'
# DataTables
gem 'jquery-datatables-rails', '3.4.0' # git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-ui-rails', '5.0.5'
# Editing in line:
gem 'best_in_place', '3.1.0'
# Passing data from controller to coffeescript
gem 'gon', '6.0.1'
#gem 'jquery-turbolinks' '2.1.0'
# For searching and webservice queries-NO LONGER USED
#gem 'sunspot_rails', '2.1.0'
#gem 'sunspot_solr', '2.1.0'
gem 'progress_bar', '1.0.5'
gem 'responders', '2.2.0'
# Calendar Date and Validation
gem 'bootstrap-datepicker-rails'
# For Google Maps overlays
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails', '~> 1.8.3'
group :development, :test do
gem 'rspec-rails', '3.4.2'
gem 'guard-rspec', '4.7.2'
gem 'spork-rails', '4.0.0'
gem 'childprocess', '0.5.9'
gem 'guard-spork', '2.1.0'
end
group :test do
gem 'selenium-webdriver', '2.53.3'
gem 'capybara', '2.7.1'
gem 'factory_girl_rails', '4.7.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.1.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.5.0'
group :doc do
gem 'sdoc', '0.4.1', require: false
end
gem 'rails_12factor', '0.0.3'
It's all in the error message:
You ave specified gems in your Gemfile which have conflicting dependencies on the rack gem. Rails 5 (via actionpack) required rack 2 which your pinned version of sprockets requires rack 1.
Thus, you have two options:
You could downgrade your rails requirement to Rails 4 which then depends on rack 1. For that, replace the line in your Gemfile where you specify rails with this:
gem 'rails', '< 5'
Alternatively (and this is probably your desired option), you could upgrade the version of sprockets you are using. For that, you can simply remove the explicit pinned version to sprockets in your Gemfile. Since Rails already depends on a suitable version of sprockets, you don't need to specify it as a version youself. Generally, in order to use sprockets with Rails 5, you need at least sprockets 3.3.5.
Has anyone successfully installed the D3js gem for rails.
I have the recent version, gem 'd3js-rails', '~> 3.1', '>= 3.1.6'
When I bundle install I receive a message saying bundler cannot find compatible versions:
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies.........
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails (~> 4.2) was resolved to 4.2.1, which depends on
railties (< 5.2.x, >= 4.0.0)
d3js-rails (>= 3.1.6, ~> 3.1) was resolved to 3.1.6, which depends on
railties (< 5.0, >= 3.0)
rails (>= 5.0.0.1, ~> 5.0.0) was resolved to 5.0.0.1, which depends on
railties (= 5.0.0.1)
react-rails (>= 1.7.1, ~> 1.7) was resolved to 1.9.0, which depends on
railties (>= 3.2)
sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
My gem file looks like this:
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'pg', '~> 0.18.4'
gem 'react-rails', '~> 1.7', '>= 1.7.1'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'devise'
gem 'd3js-rails', '~> 3.1', '>= 3.1.6'
gem 'bootstrap-sass'
gem 'yahoo-finance'
gem 'rails_12factor', group: :production
group :development, :test do
gem 'byebug', platform: :mri
gem 'pry-rails'
gem "better_errors"
end
group :development do
gem 'web-console'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
What is the actual issue? Has anyone had similar problems with installing d3js-rails?
Successfully installed found no issues.
Suggestion: Try to update your rubygem manager, rails & installed gems if they are not up to date. It seems you are having compatibility issues with your gems.
gem update --system && gem update
Otherwise:
use
gem 'rails', '~> 4.2', '>= 4.2.7.1'
gem 'sass-rails', '~> 4.0', '>= 4.0.5'
gem 'coffee-rails', '~> 4.0', '>= 4.0.1'
gem 'react-rails', '~> 1.8', '>= 1.8.2'
instead of your current version then use
bundle update
and then
bundle install.
Hope this will work.
Good Luck!
I'm a ruby/rails newbie.
Here is my gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.0'
group :development do
gem 'sqlite3', '1.3.8'
gem 'ruby-debug-ide'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem 'wash_out', :git => 'git://github.com/inossidabile/wash_out.git'
gem 'haml'
gem "railties", "~> 4.0.0"
group :doc do
gem 'sdoc', '0.3.20', require: false
end
On bundle update, I get this:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 4.0.0) ruby depends on
railties (= 4.0.0) ruby
sass-rails (= 4.0.0) ruby depends on
railties (4.0.1.rc1)
The sass-rails issue should be solved since I'm using ~> correct? How can I have both rails and sass-rails installed at the same time?
If you put sass-rails before rails in your Gemfile, it resolves correctly.
Your problem is that you can only use one version of a gem at a time. the ~> will only allow for version changes on that gem.
You need to change the version of sass-rails you're requiring to 4.0.1.
You should update the following line in your Gemfile:
gem 'rails', '4.0.0'
to
gem 'rails', '~> 4.0.0'
and then run bundle update.