I was trying to update my rails app from Rails 6.1 to 7.0.4.
When I try to bundle install after updating rails and ruby on my gemfile.
I couldn't find any gem version to change on my gemfile.
Here's my gemfile :
ruby "3.1.2"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem "rails", "~> 7.0.4"
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
gem 'activerecord', '>= 7.0.4'
gem 'actionpack', '>= 7.0.4'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
gem 'devise'
gem 'pundit'
gem 'simple_token_authentication'
gem 'autoprefixer-rails'
gem 'font-awesome-sass', '~> 6.1'
gem 'simple_form'
# Charts
gem "chartkick"
# Generateur de PDF
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'wkhtmltopdf-heroku', '2.12.6.0'
# Editeur de texte
gem 'ckeditor', github: 'galetahub/ckeditor'
gem "mini_magick"
gem "select2-rails"
gem 'select2_simple_form', github: 'lndl/select2_simple_form', tag: '0.7.3'
gem 'sidekiq'
gem 'sidekiq-failures', '~> 1.0'
# Cloud Storage
gem "aws-sdk-s3", require: false
gem "down"
gem "image_processing", ">= 1.2"
# transform file via zip
gem 'rubyzip', '>= 1.0.0'
gem 'zip-zip'
# XML reader
gem 'nokogiri', '~> 1.6', '>= 1.6.6.2'
group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'dotenv-rails'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
And here's the error I always get :
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (~> 7.0.4) was resolved to 7.0.4, which depends on
actionpack (= 7.0.4)
simple_token_authentication was resolved to 1.13.0, which depends on
actionpack (< 5, >= 3.2.6)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (~> 7.0.4) was resolved to 7.0.4, which depends on
activerecord (= 7.0.4)
simple_token_authentication was resolved to 1.5.2, which depends on
activerecord (< 5, >= 3.2.6)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 7.0.4)
simple_token_authentication was resolved to 1.0.0.pre.beta.2, which depends on
rails (~> 4.0.0)
I've tried to reinstall bundle and each gems by looking at the dependencies showed here : https://rubygems.org/gems/rails/versions/7.0.4/dependencies.
After many researchs, I coudln't find a way to unlock the situation, each tries leads to the dependencies error showed earlier.
Actionpack and activerecord are bundled directly with rails, so it updates alongside.
simple_token_authentication is dependent on an earlier version of rails, so you need to update it as well.
It appears to be dependent in <5 which is odd considering you say you’re updating from 6.1, but I’ll assume your bundle functioned before.
However, it looks like you’re using the latest version, so your options are to find a different gem or wait for the gem to be updated.
Related
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.
I am attempting to install kaminari, but Rails cannot find it or a dependency (I've run into both - currently dependency):
∴ bundle exec rails g kaminari:config
Could not find i18n-1.8.4 in any of the sources
Run `bundle install` to install missing gems.
This is despite it being installed:
∴ bundle info i18n
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
* i18n (1.8.4)
Summary: New wave Internationalization support for Ruby
Homepage: https://github.com/ruby-i18n/i18n
Path: /Users/shawn/.rvm/gems/ruby-2.6.3#refstats/gems/i18n-1.8.4
I first attempted to delete Gemfile.lock. Same result. Then I deleted the refstats gemset and recreated it. Same result. Then I tried bundle install --force and got same result.
I've tried both gem 'kaminari', '~> 1.2' and gem 'kaminari' in my Gemfile.
Any suggestions?
EDIT:
Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3', '~> 1.4'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
gem 'devise', '~> 4'
gem 'kaminari'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
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.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
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Edit 2:
∴ cat .ruby-version
ruby-2.6.3
I have no .ruby-gemset, but my console is reporting I'm using the right one:
12:36:50 shawn#macbook-pro:~/Documents/uga/refstats (git:master:547a0b4) ruby-2.6.3#refstats
∴
EDIT 3:
Well, the gremlin has disappeared, though I cannot say why. This is what I did:
1) Created new test rails app
2) Bundle install in new gemset
3) Added kaminari to Gemfile
4) Bundle install
5) Generated kaminari config successfully
6) Switch to non-working app, but forget to switch gemset, putting me in rvm with no gemset. Don't notice.
7) Bundle install
8) Notice things get installed, including kaminari. Notice I'm on wrong gemset.
9) Switch to correct gemset.
10) Bundle install (which installs nothing)
11) Generate kaminari config successfully
I really cannot say why it started working, unless installing to the rvm root had some effect. But that's what I did, and it's all working now. Thanks for the time.
Just because the gem is installed on your machine does not mean it is part of your bundle. bundle exec scopes the available gems to only what is included in your Gemfile and those gems dependencies. See if i18n for that version shows up when you run bundle show.
thank you for taking the time to read this. I'm extremely new to this, and am currently following a textbook for learning Rails, so apologies if I'm slow to pick up instruction. I'm currently on Chapter 5 of the Ruby on Rails tutorial (3rd edition), and part of this is my fault as I fiddled with something (I'm not exactly sure what) and now I get this error: I'm trying to install Bootstrap, and I was supposed to add a line of code in my gemfile. But now every time I try to run bundle install, I receive this error.
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: rails (= 4.2.2) and rails (~> 6.0.3, >= 6.0.3.1). Bundler cannot continue.
# from /home/ubuntu/environment/sample_app/Gemfile:10
# -------------------------------------------
# # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
> gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
# # Use sqlite3 as the database for Active Record
# -------------------------------------------
I know it's probably something basic and obvious, but I would appreciate explicit instruction because I'm completely lost. Any and all help is appreciated! This is what my Gemfile looks like:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'bootstrap-sass', '3.2.0.0'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '> = 4.1.2', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
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.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
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
As the error message says, you have a couple of declarations for the rails gem.
Remove gem 'rails', '4.2.2' (at the top of the file, after source 'https://rubygems.org') and run bundle install (or just bundle).
Hope this helps!
Rails is defined twice on your Gemfile.
First on line 3 and the second on line 10. Just remove the first from line 3 and try bundle install again.
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.
So Solidus is a fork of Spree and Spree is no longer maintained.
Am following the instructions on the Solidus's Github page (https://github.com/solidusio/solidus) to install it. And am stuck at this command bundle exec rails g spree:install this command raises the following error:
/Users/user1/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/handlebars_assets-0.19.1/lib/handlebars_assets.rb:20:in 'block in register_extensions': undefined method 'register_engine' for nil:NilClass (NoMethodError)
Not sure if this might help but before trying to install Solidus I was working on a Spree project.
Also, here is my Gemfile:
source 'https://rubygems.org'
# Solidus E-Commerce
gem 'solidus'
gem 'solidus_auth_devise'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
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
Any help is really appreciated.
Update:
This is a known bug with handlebars-assets gem, which is resolved in master.
Adding the line :
gem 'handlebars_assets', github: 'leshill/handlebars_assets'
to your Gemfile will solve your problem until a new version contains the relevant fix.
Move the lines :
gem 'solidus'
gem 'solidus_auth_devise'
below gem 'rails', '4.2.4' because the former depends on the latter.
We've released a new version of solidus (v1.1.1) which locks sprockets-rails to 2.x to fix this issue.
https://github.com/solidusio/solidus/releases/tag/v1.1.1
In lieu of upgrading you can also specify the older sprockets-rails version in your Gemfile
gem "sprockets-rails", "~> 2.3"