Currently all the gems (aside from assets) are popped into the default gem group. I would suggest moving Capybara and others out to group "tests" and so on.
Rails Composer templates are created by the Rails Apps Composer Gem. For that reason, groups such as :development or :test are specified inline. In the tutorial, I suggest, "You can reformat the Gemfiles to organize groups in an eye-pleasing block style. The functionality is the same."