What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial

Greetings

People who know the Hello! Nice to meet you if you don't know! It is Atie of a metamorphosis junior high school student who masters programming by himself! This time I found a solution to the error that I had been fighting for about 3 days, so I will leave a record here Now you can finally proceed with the Rails tutorial

In conclusion ...

** I installed the latest version of Ruby (3.0.0) and couldn't resolve the dependencies and it didn't work! ** ** It didn't work because of that So I installed the same version of Ruby 2.6.3 as the Rails tutorial and set Global to 2.6.3 and it worked!

Development environment

Ruby 3.0.0 Rails 6.0.3.4 Gemfile.lock has been deleted Contents of Gemfile (The name is "Gemfile", but it is written in Ruby code and has a .rb extension intentionally for easy understanding. In the production environment, .rb is not attached. Is added as an extension)

Gemfile.rb


source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem 'rails',      '6.0.3'
gem 'puma',       '4.3.6'
gem 'sass-rails', '5.1.0'
gem 'webpacker',  '4.0.7'
gem 'turbolinks', '5.2.0'
gem 'jbuilder',   '2.9.1'
gem 'bootsnap',   '1.4.5', require: false

group :development, :test do
  gem 'sqlite3', '1.4.1'
  gem 'byebug',  '11.0.1', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  gem 'web-console',           '4.0.1'
  gem 'listen',                '3.1.5'
  gem 'spring',                '2.1.0'
  gem 'spring-watcher-listen', '2.0.1'
end

group :test do
  gem 'capybara',           '3.28.0'
  gem 'selenium-webdriver', '3.142.4'
  gem 'webdrivers',         '4.1.2'
end

#On Windows tzinfo for timezone information-Must include data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Details of the error

First of all, when I did bundle install, I got the following error

$ bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
You have requested:
  listen = 3.1.5

The bundle currently has listen locked at 3.3.3.
Try running `bundle update listen`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

The content of the error is "The version is locked, so please update with bundle update!"

$ bundle update
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby armv7l-linux-eabihf

    capybara (= 3.28.0) armv7l-linux-eabihf was resolved to 3.28.0, which depends on
      Ruby (>= 2.4.0) armv7l-linux-eabihf

    listen (= 3.1.5) armv7l-linux-eabihf was resolved to 3.1.5, which depends on
      Ruby (>= 2.2.3, ~> 2.2)

    puma (= 4.3.6) armv7l-linux-eabihf was resolved to 4.3.6, which depends on
      Ruby (>= 2.2) armv7l-linux-eabihf

    selenium-webdriver (= 3.142.4) armv7l-linux-eabihf was resolved to 3.142.4, which depends on
      Ruby (>= 2.3) armv7l-linux-eabihf

The content is "There is a conflict!"

When I try to google, what about the dependency ... **that? Wait a minute, is the Ruby version the same as the Rails tutorial version? ** ** The question passed through my head At that time, I came here! So first I checked the Ruby version of the Rails tutorial The initial Gemfile for the Rails tutorial looked like this:

Gemfile.rb


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'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5'
# 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', '>= 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.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

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]

Rails tutorial version is 2.6.3 and my environment is 3.0.0 ... ** It's too different! !! That won't work! (3.0.0 has been significantly improved with a major update ... For more information, go to here) ** Yes, the version was significantly different There is Especially when using Linux, even if you try to run a program etc., it often does not work due to the dependency of the version of the library etc. (especially Fedora etc. that you are using)

Hahhhhh ... I'm tired ... it finally works ... (It's not a flag \ (^ o ^) /)

So it worked!

Finally

This time it was an error that took a long time to resolve I was able to experience this time and I think that I was able to grow as a programmer once. Finding and resolving the cause of an error is also an essential skill of a programmer. And this time I was able to learn a lot about the importance of versions such as dependencies. I hope this article has helped you solve your errors. Thank you for reading until the end See you in the next article! Atie's Twitter

Recommended Posts

What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if you can't use the rails command
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
What to do if you can't install the plugin from the Eclipse marketplace
What to do if the Rails server can't start
[Rails] What is the difference between bundle install and bundle update?
What to do if the update does not take effect after deploying Rails AWS
What to do if you can't get the text of an element in Selenium
What to do if you can't find your API key after deploying to Rails heroku
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
[Rails] What to do if you can't get an error message with the errors method
What to do if you install Ubuntu
Things to remember and concepts in the Ruby on Rails tutorial
What to do if you can't find the JDK you put in SDKMAN after migrating from bash to zsh on macOS
What to do if you forget the root password in CentOS7
[Rails] What to do if you can't get parameters with form_with
Add gem'rails-i18n','~> 6.0.0' and what to do if bundle install gives an error
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you can't activate the select box created by bootstrap-select
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if rails server can't be stopped
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapters 4 and 5
I changed the Ruby version and now I can't bundle install
What to do if you get a java.io.IOException in GlassFish
# What to do if you accidentally do rails db: migrate: drop
What to do if mysql2 gets a bundle install error
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
What to do if you enable UFW on Ubuntu VM on GCP and you can't connect to SSH
What to do if you don't see the test code error message in the terminal console
What to do if you installed Ruby with rbenv but the version does not change
What to do if you get a "302" error in your controller unit test code in Rails
What to do if you get an error in Basic authentication during Rails test code
What to do after Vagrant install
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do if you get a gcc error in Docker
What to do if validation doesn't work with the update action
[Rails] What to do if data is not registered in DB
What to do if you get a DISPLAY error in gym.render ()
I want to add devise in Rails, but I can't bundle install
What to do if you get angry with OpenSSL with pyenv install
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
What to do if Could not find hoge in any of the sources Run `bundle install` to install missing gems. Appears in the docker container
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get an error during rails db: reset
What to do if the background image is not applied after deployment
What to do if the prefix c is not bound in JSP
[Composer] [Laravel] What to do if you cannot install due to insufficient memory
What to do when Blocked Host: "host name" appears in Ruby on Rails
What to do and how to install when an error occurs in DXRuby 1.4.7
What to do if an error occurs when nokogiri enters when bundle install
What to do if you don't like the code generated by swagger-codegen-cli
What to do if Operation not permitted is displayed when you execute a command in the terminal
[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
What to do when you think you can't do Groovy-> Java in IntelliJ IDEA CE
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapter 6
What to do if you get Could not locate Gemfile or .bundle / directory