I updated my ruby to 3.0.0 but for some reason now my application doesn't work. I have searched online for different answered but I cannot find anything. This error has gotten me going crazy now. Here is what happens.
When I do bundle update I get:
Bundler could not find compatible versions for gem "ruby":
In Gemfile:
ruby (~> 3.0.0)
thredded (~> 0.16.13) was resolved to 0.16.16, which depends on
ruby (~> 2.3)
I looked online and someone said to do bundle update rails but when I do I get this error:
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
active_model_serializers was resolved to 0.10.10, which depends on
activemodel (>= 4.1, < 6.1)
challonge-api was resolved to 0.2.0, which depends on
activeresource was resolved to 5.1.0, which depends on
activemodel-serializers-xml (~> 1.0) was resolved to 1.0.2, which
depends on
activemodel (> 5.x)
challonge-api was resolved to 0.2.0, which depends on
activeresource was resolved to 5.1.0, which depends on
activemodel (>= 5.0, < 7)
carrierwave was resolved to 2.0.2, which depends on
activemodel (>= 5.0.0)
rails (= 6.1.2.1) was resolved to 6.1.2.1, which depends on
activemodel (= 6.1.2.1)
Any ideas what I need to do?
Here is my gem file:
source 'https://rubygems.org'
ruby '~> 3.0.0'
Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '6.1.2.1'
Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0.0'
Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'merit', '= 3.0.1'
Used to implement at.js for auto complete mentions/emojis
gem 'jquery-atwho-rails'
Use twitter bootstrap sass
gem 'bootstrap-sass', '~> 3.4.0'
gem 'autoprefixer-rails'
gem 'font-awesome-rails'
gem 'font-awesome5-rails', '~> 1.0', '>= 1.0.1'
gem 'font_awesome5_rails'
gem 'xbox_live_api'
gem 'faraday'
gem 'oj'
gem 'thredded', '~> 0.16.13'
gem 'rails-ujs'
group :development do
gem 'spring'
gem 'letter_opener'
gem 'guard'
gem 'guard-rspec', '~> 4.2.8'
gem 'byebug'
end
group :development, :test do
gem 'puma'
gem 'sqlite3', '~> 1.3.6'
end
group :production do
gem 'pg', '~>0.18'
gem 'unicorn'
gem 'cloudinary'
gem 'rails_12factor'
gem 'fog'
gem 'fog-aws'
end
gem 'devise'
gem 'carrierwave'
gem 'friendly_id', '~> 5.0'
gem 'will_paginate', '~> 3.1.0'
gem 'public_activity'
gem 'acts_as_votable', '~> 0.10.0'
gem 'acts_as_commentable'
gem 'acts_as_follower'
gem 'counter_culture', '~> 0.1.33'
gem 'faker'
gem 'populator'
gem 'auto_html', '~>1.6.4'
gem 'sanitize'
gem 'active_model_serializers'
gem 'private_pub'
gem 'thin'
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
Use debugger
gem 'debugger', group: [:development, :test]
gem 'round_robin_tournament'
gem 'tournament-system', '~> 2'
gem 'challonge-api'
gem 'tournament'
gem 'oauth2'
gem 'activerecord-session_store'
gem "simple_calendar", "~> 2.0"
Currently Ruby 3.0 is not supported with Rails, as there will be next release for Rails. You can do following and it works by installing dev branch of ruby 3. I used ruby 3.1.0dev (2021-02-14T05:09:08Z master ff527e7e32) [x86_64-darwin19] Following commands are with RVM you can use same with other softwares I tried by installing
rvm install ruby-head
This command installed version ruby 3.1.0dev Now install rails
gem install rails
Now create new project
rails new test_rails
now run it using rails s' if you are getting error that ruby version 3.1.0 required is because rails has added this in .ruby-version` so it is just warning no issue. You can try latest version but as I said it is dev version not stable. Note ruby-head will keep changing version of ruby installed as it is latest version. And good news it is blazing fast! I love it.
I suggest use ruby 2.7.2 with rails 6 till new release comes, the above is for test purpose only, not production or actual product. You should use ruby 2.7.2 for production or product.
Related
I'm doing this upgrade for the first time and I'm facing problem on very first step :-(
Basically I want to upgrade rails version of my project so I changed my Gemfile for the rails 5.2 and tried to run:
bundle update rails
as given here but I can not update bundle and am getting the following error
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (~> 5.2) was resolved to 5.2.1.rc1, which depends on
activerecord (= 5.2.1.rc1)
schema_plus_views was resolved to 0.3.1, which depends on
activerecord (~> 4.2)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.2)
gaffe was resolved to 1.2.0, which depends on
rails (>= 4.0.0)
rails_admin was resolved to 1.3.0, which depends on
rails (< 6, >= 4.0)
rails_admin_globalize_field was resolved to 0.4.0, which depends on
rails (>= 4.2)
sql-logging was resolved to 3.0.10, which depends on
rails (>= 4.0)
Bundler could not find compatible versions for gem "rake":
In Gemfile:
rake (~> 11.2)
capistrano (~> 3.6) was resolved to 3.11.0, which depends on
rake (>= 10.0.0)
derailed_benchmarks was resolved to 1.3.2, which depends on
rake (< 13, > 10)
My Gemfile is
source 'https://rubygems.org'
gem 'pg', platform: :ruby
gem 'schema_plus_views'
gem 'fix-db-schema-conflicts', github: 'davidlibrera/fix-db-schema-conflicts'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rake', '~> 11.2'
gem 'rails', '~> 4.2'
# gem 'rb-readline'
# Use postgresql as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails'
gem "less-rails", platform: :ruby #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails'
gem "typescript-rails"
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem "bootstrap-sass"
gem "font-awesome-rails"
gem 'haml'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem "bower-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 'oj'
gem 'jbuilder'
gem 'angular-rails-templates'
gem 'gaffe'
gem 'color-generator'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1'
# we have keep redis client below version 4 until this issue is solved
# https://github.com/antirez/redis/issues/4272
# and we have to keep redis below 3.3.2 until this issue is solved
# https://github.com/redis/redis-rb/issues/650
gem 'redis', '3.3.5', require: %w(redis redis/connection/hiredis)
gem 'hiredis'
gem 'puma'
gem 'puma_worker_killer'
gem "dalli"
gem 'jbuilder_cache_multi'
gem 'globalize', '~> 5.0'
gem 'rack-attack'
gem 'ya2yaml'
gem 'cells-rails'
gem 'cells-erb'
# gem 'highline'
gem 'kaminari'
gem 'nokogiri'
gem 'zss', git: "https://github.com/ISEngineering/zmq-service-suite-ruby", platform: :ruby
gem 'ffi-rzmq', '2.0.4'
gem 'therubyracer'
gem "paperclip", "~> 4.3"
gem 'bootstrap-wysihtml5-rails'
gem 'rails-i18n', '~> 4.0'
# Excel depdendencies
gem 'xlsxtream', '>= 2'
# Excel legacy export
gem 'axlsx_rails', '0.5.1'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
gem 'rubyzip', '>= 1.2.1'
gem 'zip-zip'
gem 'devise', '~> 4.2'
gem 'devise-i18n'
gem 'savon', '~> 2.10'
gem 'party_foul', git: 'https://github.com/alexanderadam/party_foul.git', branch: 'bugfix/132-dont-assume-that-exceptions-have-a-backtrace' #'>= 1.5.5'
gem 'ledermann-rails-settings'
gem 'dentaku'
gem 'delayed_job_active_record'
gem 'cancancan'
gem 'rolify'
gem 'rails_admin'
gem 'enumerize'
gem 'rails_admin_settings'
gem 'rails_admin_globalize_field'
gem 'trailblazer-rails'
gem 'premailer-rails'
gem 'bulk_insert'
# for assets that are referenced by libraries in vendor/assets
gem 'non-stupid-digest-assets'
gem 'actionpack-action_caching'
gem 'dotenv-rails'
group :development, :test do
gem 'database_cleaner'
gem 'rspec-rails'
gem 'pry'
gem 'pry-nav'
gem 'awesome_print'
gem 'mocha'
gem 'webmock' # for vcr
gem 'vcr'
gem 'chromedriver-helper', '>= 2.1.0'
gem 'selenium-webdriver', '3.9.0'
gem 'capybara'
end
group :test do
gem 'factory_bot_rails'
gem 'db-query-matchers'
gem 'capybara-screenshot'
gem 'fakeredis', require: 'fakeredis/rspec'
end
group :development do
gem 'i18n-tasks'
gem 'spring'
gem 'letter_opener'
gem 'derailed_benchmarks'
gem 'sql-logging'
gem 'rubocop'
gem 'rubocop-rspec'
gem 'fasterer'
gem 'better_errors'
gem 'binding_of_caller'
gem 'activerecord-colored_log_subscriber' # this won't be required with rails 5 anymore
# Use Capistrano for deployment
gem 'capistrano', '~> 3.6'
gem 'capistrano-rbenv', '~> 2.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails'
gem 'capistrano3-puma', github: "seuros/capistrano-puma"
gem 'capistrano3-delayed-job', '~> 1.0'
end
group :profile do
gem 'ruby-prof'
end
gem 'sdoc', group: :doc
gem 'sshkit' # is needed to load tasks on server
What should I do?
First, as ThorTL67 noted in the comments, it is a good idea to update your Rails version incrementally, not in one big leap. That way, your dependency issues will be less complex.
Check what version of Bundler you are using by running bundle version. If that version is old, it might be that some dependencies are not correctly calculated, and it might help to update Bundler (gem update bundler).
Then to the steps you can take to update from 4.2 to 'some higher version'. The list of errors that you got shows the conflicts between gem dependencies. You can try and tackle these conflicts one by one.
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (~> 5.2) was resolved to 5.2.1.rc1, which depends on
activerecord (= 5.2.1.rc1)
schema_plus_views was resolved to 0.3.1, which depends on
activerecord (~> 4.2)
This error is pretty straightforward. It tells you that gem rails needs activerecord v5.2.1, but that gem schema_plus_views needs activerecord >= 4.2.0 but < 5.0 (see the RubyGems explanation of constraints). So how to resolve this? If you check the source page for schema_plus_views, you see that there is no compatible version yet for activerecord v5.2.1, and that it is not likely to be there soon: Any plan to update this gem to be compatible with rails 5.2?
So in this case, you have a few options. Leave it out of your Gemfile and remove the dependencies on this gem from your code; check for alternative gems that give you the needed functionality; help to update the gem to support rails 5.
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.2)
gaffe was resolved to 1.2.0, which depends on
rails (>= 4.0.0)
rails_admin was resolved to 1.3.0, which depends on
rails (< 6, >= 4.0)
rails_admin_globalize_field was resolved to 0.4.0, which depends on
rails (>= 4.2)
sql-logging was resolved to 3.0.10, which depends on
rails (>= 4.0)
I'm actually not sure what the problem is here. These dependencies on the rails gem do not seem to contradict each other, so I would try to find out what gem is the actual problem by commenting them out one by one and then trying the update again. This might give you more information.
Bundler could not find compatible versions for gem "rake":
In Gemfile:
rake (~> 11.2)
capistrano (~> 3.6) was resolved to 3.11.0, which depends on
rake (>= 10.0.0)
derailed_benchmarks was resolved to 1.3.2, which depends on
rake (< 13, > 10)
This also seems like it should not be a problem. I would try to change your rake dependency in your Gemfile from gem 'rake', '~> 11.2' to gem 'rake' and see what happens with the dependency messages.
Chances are that after all these steps, you will get different error messages. You have to tackle them one by one in the same manner. Unfortunately, there is no silver bullet, and updating Rails can be a tedious process, especially when your application depends on a lot of gems. You have to fix this, issue by issue, by removing your own dependencies on gems, helping gem communities with maintenance/updates, or (worst case) forking a gem and changing the code yourself to make it work again for your application. Good luck!
In order to update your dependencies, you can use tools like bummr. Please, be sure to have a good test suite as the README specify. After that, you can start fixing compatibility issues, deprecations and more.
I am using
gem 'axlsx_rails'
gem 'acts_as_xlsx'
for downloading file into excel.
Now I am trying to add the following gem
gem 'caracal'
for downloading file into docx.
Whenever, I am trying to run
bundle install, I got the following error
Bundler could not find compatible versions for gem "rubyzip": In
snapshot (Gemfile.lock):
rubyzip (= 1.0.0)
In Gemfile:
acts_as_xlsx was resolved to 1.0.6, which depends on
axlsx (>= 1.0.13) was resolved to 2.0.1, which depends on
rubyzip (~> 1.0.0)
caracal was resolved to 0.1.0, which depends on
rubyzip (~> 1.1)
Running bundle update will rebuild your snapshot from scratch, using
only the gems in your Gemfile, which may resolve the conflict.
My gem file looks like following
source 'https://rubygems.org'
gem 'rails', '4.1.9'
gem 'mysql2', '~> 0.3.19'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'devise'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'capistrano', '~> 3.4.1'
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rvm'
end
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails', '3.2.0'
gem 'cancan'
gem 'carrierwave', github: 'carrierwaveuploader/carrierwave'
gem 'rmagick'
gem 'caracal'
gem 'activerecord-session_store', github:
'rails/activerecord-session_store'
gem 'carmen-rails', '~> 1.0.0'
gem 'wicked'
gem 'figaro'
gem 'bootstrap-datepicker-rails'
gem 'axlsx_rails'
gem 'acts_as_xlsx'
I have solved the problem by adding
gem 'axlsx', '~> 2.1.0.pre'
in the gem file. This gives an error first then I had to update rubyzip. After that I run
bundle install
The axlsx_rails gem hasn't been updated for quite a while and it depends on a version of the axlsx gem that depends on a 1.0.x version of the rubyzip. Whereas caracal depends on a version >= 1.1. That said: Current versions of that gem will not work together.
But an even older version of the axlsx 1.3.6 had a more relaxed dependency to the rubyzip gem - it only requires its version to be >= 0.9.5.
Therefore I suggest - if possible - to downgrade axlsx_rails to 0.1.2 and try again:
# add a version to the axlsx_rails gem in your Gemfile
gem 'axlsx_rails', '0.1.2'
And run bundle install again.
I just set up spree successfully but want to add a new theme into it.
I chose that one :
https://github.com/dbwinger/spree_serenity_theme
But when I try a "bundle install", I get the following message :
Bundler could not find compatible versions for gem "spree_core":
In snapshot (Gemfile.lock):
spree_core (= 3.0.4)
In Gemfile:
spree_core (= 3.0.4) ruby
spree_core (~> 3.0.0) ruby
spree_core (~> 3.0.0) ruby
spree_fancy (>= 0) ruby depends on
spree_core (~> 2.3.0.beta) ruby
Running `bundle update` will rebuild your snapshot from scratch,
using only the gems in your Gemfile, which may resolve the conflict.
Any Idea to fix this issue ?
Ruby : 2.2.2p95
Rails : 4.2.2
Gemfile :
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'mysql2', '~> 0.3.18'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
end
gem 'spree', '3.0.4'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_serenity_theme', :git => 'https://github.com/dbwinger/spree_serenity_theme.git'
Thanks for your help
The Gem spree_serenity_theme is compatible with spree version 2 and not with spree version 3.
Check the dependencies of the gem https://github.com/dbwinger/spree_serenity_theme/blob/master/spree_serenity_theme.gemspec
That's why it is not working.
The current version of spree core is 3.0.4, You will have to install spree from 2-0 stable branch of the spree and not from the master branch.
https://github.com/spree/spree/tree/2-0-stable
You can create a fork of the theme and make changes according to your requirement for the latest version of spree
Thank you
I'm trying to install the Sass Rails Source Maps on my ruby project but it's failing.
Im getting the next error when writing bundle update sass:
Bundler could not find compatible versions for gem "sass":
In Gemfile:
sass-rails (~> 4.0.3) ruby depends on
sass (~> 3.2.0) ruby
In my Gemfile I have the next related gems:
gem 'sass-rails', '~> 4.0.3'
gem 'sass', '~> 3.3.7'
group :development do
gem 'sass-rails-source-maps'
end
What am I missing?
Looks like it doesn't fit, even master branch uses 'sass', '~> 3.2'.
As a solution you can fork sass-rails and update sass-rails.gemspec with s.add_dependency 'sass', '>= 3.2' instead of '~> 3.2' and use it in your Gemfile:
gem 'sass-rails', github: 'your_nick/sass-rails' # your_nick - your username on Github
I couldn't work, but you can try.
I have installed jruby and trying to use Neo4j for my Rails app. But typing bundle install gives me the following conflict.
Bundler could not find compatible versions for gem "railties":
In Gemfile:
neo4j (>= 2.2.3) java depends on
railties (< 3.3, >= 3.0.0) java
rails (= 4.0.0) java depends on
railties (4.0.0)
Here's my gemfile:
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'sass-rails'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails'
gem 'therubyrhino'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'unicorn'
gem 'capistrano', group: :development
group :development, :test do
gem "rspec-rails"
end
gem "neo4j", ">= 2.2.3"
Should I remove my Gemfile.lock and run bundle update? Thanks!
There is a branch for rails 4 in the neo4j project, so you can just specify it in Gemfile:
gem 'neo4j', git: 'git://github.com/andreasronge/neo4j.git', branch: 'rails4'
That says that the currently available version of neo4j require a version of railties < 3.3, but rails 4.0.0 requires version 4.0.0 of railties: bundler cannot resolve this conflict.
The only way out of this is for neo4j to be updated to work with rails 4.0. It is entirely possible that neo4j's version constraint on railties is a precaution only - there may be nothing more to do than checking that everything still works under 4.0.