Comments in Gemfile, round 2

I agree Flag to not leave so many comments in the default Gemfile wasn’t a very constructive thread, but I think there is some merit in reviewing these comments. You can see the current base Gemfile in that thread. Here’s what I’m proposing:

source ''
git_source(:github) { |repo| "{repo}.git" }

ruby '2.6.4'

# The base Rails gem, where most of the magic happens!
gem 'rails', '~> 6.0.3'
# Puma is the app server Rails runs on. Learn about Puma:
gem 'puma', '~> 4.1'

# Most Rails apps will use these gems, but you can change or remove them if needed:

# Use SQLite as the database. PostgreSQL and MySQL are also supported.
# To change database, read
gem 'sqlite3', '~> 1.4'
# Use SCSS for easy to write CSS:
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more:
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more:
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more:
gem 'jbuilder', '~> 2.7'

# Optional gems needed by specific Rails features:

# If using ActionCable, use the Redis adapter.
# gem 'redis', '~> 4.0'
# Use bcrypt to encrypt passwords securely. Works with
# gem 'bcrypt', '~> 3.1.7'

# The gems below will make development easier, but if they cause problems it's OK to remove them

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]

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:
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'

group :test do
  # These gems are needed for

  # 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'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# If you don't use Windows you can remove this gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]


  • For each gem there is a link or a solid explanation of what the gem does.
  • Gems that you can change are called out. Gems that you shouldn’t change are not.
  • It’s better to have multi-line comments or extra spacing than it is to have confusing comments.


  • I don’t know much about jbuilder. I’ve never used it. Does every single Rails user need it on by default?


  • Removed note about bundling edge rails as it’s only useful for power users.
  • Explained how to change your DB + added a link to Configuring Rails Applications — Ruby on Rails Guides (which could probably be better but that’s another story)
  • If you google has_secure_password you don’t get any great results. I imagine this confuses lots of people when it’s mentioned in the Gemfile. I’ve removed it and made the comment around bcrypt more generic for this reason.
  • I removed image_processing entirely. Active Storage Overview — Ruby on Rails Guides introduces it, but I don’t see why every single user needs to be told about it.
  • Moved bootsnap to the bottom. It’s not something new users should think about.



This feels like it’s something you could break up into a series of PRs without too much effort. I think improved documentation is basically always welcome. :slight_smile:

1 Like

I’d love to put it all in one PR unless anything seems particularly controversial.

Do you have any thoughts on the jbuilder question? / can you suggest who the best person to ask about that is?

I know that jbuilder is used for JSON APIs by people who don’t write serializer classes. In spirit it’s “ERB for JSON” (though that’s not at all what jbuilder files look like.)

I think that the gem removal is likely to be controversial in ways that would benefit from a separate PR, but on further thought I agree that the reorganization is likely to be easy to review as a block otherwise.

I don’t use it either, but I can see myself reaching for it if I’m building an app which only needs structured JSON sprinkles here and there

We are off the topic of comments in the gemfile. Removing jbuilder by default would be a good new topic though!

1 Like