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
** 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!
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]
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!
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