I don't know

RailsTutrial (a little further) With version 5.1.6 rails file, there is a work of rewriting gemfile to make learning easier, but this is the default after installation

source 'https://rubygems.org'
git_source (: github) do | repo_name |
  repo_name = "# {repo_name}/# {repo_name}" unless repo_name.include? ("/")

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~>5.1.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~>3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~>5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms:: ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~>4.2'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~>4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~>3.1.7'
# 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', platforms: [: mri,: mingw,: x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~>2.13'
  gem 'selenium-webdriver'
group: development do
  # Access an IRB console on exception pages or by using<% = 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'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [: mingw,: mswin,: x64_mingw,: jruby]

This is a Gemfile that explicitly specifies the version for each Ruby gem on the site

source 'https://rubygems.org'
gem 'rails', '5.1.6'
gem 'puma', '3.9.1'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.6.4'
group: development,: test do
  gem 'sqlite3', '1.3.13'
  gem 'byebug', '9.0.6', platform:: mri
group: development do
  gem 'web-console', '3.5.1'
  gem 'listen', '3.1.5'
  gem 'spring', '2.0.2'
  gem 'spring-watcher-listen', '2.0.1'
# In Windows environment, you need to include a gem called tzinfo-data
gem 'tzinfo-data', platforms: [: mingw,: mswin,: x64_mingw,: jruby]

It says to rewrite it, but I don't understand the nuance of the word explicit. Should I delete the default and paste the latter Gemfile?
Or only the ones written in the latter gemfile should be rewritten in this way. For example, there are gems that are not written in the latter gemfile, such as group: development,: test do, and you can't know if I want to leave it and rewrite only the corresponding place, or delete it and make it exactly the same as the latter gemfile. Hmm.

  • Answer # 1


    Can I delete the default and paste the latter Gemfile?

    In order to proceed with the Rails Guide, we recommend that you do so.


    I don't understand the nuance of the word explicit.

    As long as you don't know when and when the Rails Guide will be used, it means that you can reproduce the exact same environment as at the time of writing by fixing the version to 0.0.1 completely.

    In the actual operation, except for the pattern that "stops because there is a bug in the new version", it seems that the minor version advances as it is like'~>4.3.1'I often leave it.