This commit addresses the CI failure at https://buildkite.com/rails/rails-nightly/builds/424#018eee82-61fb-41ae-bc2b-21bc60dde483/1240
Since https://rubygems.org/gems/sqlite3/versions/2.0.0 has been released, while Rails application just allows sqlite3 gem version 1.*
some of bug_report_templates does not have the same version requirement. these bug report templates attemp to install the latest sqlite3 version 2.0.0, it raises the LoadError.
This version requiremnt is taken from that for Rails application.
0601929486/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb (L14)0601929486/railties/lib/rails/generators/database.rb (L19)
Gemfile for Rails framework has different version requirement, this commit uses the version requirement for Rails application. Both of them eventually install the sqlite3 1.*.
0601929486/Gemfile (L157)
- Steps to reproduce
```
git clone https://github.com/rails/rails
cd guides/bug_report_templates
ruby action_mailbox.rb
ruby active_record.rb
ruby active_record_migrations.rb
ruby active_storage.rb
```
- Error without this commit
```
$ ruby action_mailbox.rb
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
-- create_table(:active_storage_blobs, {:id=>:primary_key})
/home/yahonda/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/bundler/rubygems_integration.rb:237:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.0-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (LoadError)
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:14:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_handler.rb:333:in `resolve_pool_config'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_handler.rb:134:in `establish_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_handling.rb:53:in `establish_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/railtie.rb:304:in `block (2 levels) in <class:Railtie>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `class_eval'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `block in execute_hook'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `each'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/base.rb:338:in `<module:ActiveRecord>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/base.rb:15:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:506:in `migration_class'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:510:in `migration_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1032:in `connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1037:in `block in method_missing'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1017:in `block in say_with_time'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1017:in `say_with_time'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1036:in `method_missing'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:566:in `create_table'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration/compatibility.rb:110:in `create_table'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activestorage-7.1.3.2/db/migrate/20170806125915_create_active_storage_tables.rb:6:in `change'
from action_mailbox.rb:51:in `block in <main>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:55:in `instance_eval'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:55:in `define'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:50:in `define'
from action_mailbox.rb:50:in `<main>'
/home/yahonda/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/bundler/rubygems_integration.rb:237:in `block (2 levels) in replace_gem': can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.0-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:14:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_handler.rb:333:in `resolve_pool_config'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_handler.rb:134:in `establish_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/connection_handling.rb:53:in `establish_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/railtie.rb:304:in `block (2 levels) in <class:Railtie>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `class_eval'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:97:in `block in execute_hook'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `each'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/base.rb:338:in `<module:ActiveRecord>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/base.rb:15:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:506:in `migration_class'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:510:in `migration_connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1032:in `connection'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1037:in `block in method_missing'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1017:in `block in say_with_time'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1017:in `say_with_time'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1036:in `method_missing'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:566:in `create_table'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/migration/compatibility.rb:110:in `create_table'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activestorage-7.1.3.2/db/migrate/20170806125915_create_active_storage_tables.rb:6:in `change'
from action_mailbox.rb:51:in `block in <main>'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:55:in `instance_eval'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:55:in `define'
from /home/yahonda/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activerecord-7.1.3.2/lib/active_record/schema.rb:50:in `define'
from action_mailbox.rb:50:in `<main>'
$
```
Introduce Action View bug report template for contributors to reproduce
issues with failing `ActionView::TestCase` instances.
In addition to rendering ERB with the `inline:` keyword, the sample
tests also include a `Helpers` module to demonstrate how to incorporate
view helpers into the reproduction script.
As a contributor, changing a single line to test the desired version does not warrant a separate file for each type of report.
The only argument I can see for keeping the gem versions is that users are likely reporting a bug for a specific version of Rails, typically during an upgrade. As few people are probably testing their applications against Rails main branch.
Additionally, having the gem version templates means that we are testing both main and a stable release of Rails in CI, which has some benefit.
By removing the edge version templates, we also lose that coverage in CI, but I think it's something we can fix in buildkite-config to replace the line in those guides before running them later.
IMO, the cost of separate files and the confusion it will create if we want to add more templates outweighs the benefits mentioned here.
My motivation is that I want to add more report templates, like for additional adapters, and this list will grow to be unmanageable if we keep the gem versions.
Currently only Action Mailbox and Active Storage use initialized apps, so at least in those cases we can ensure the correct defaults are used by bug reporters.
This commit locks sqlite3 gem version to 1.4
to run bug report templates using rubylang/ruby:master-nightly-focal
This issue does not reproduce Ruby 3.2.0dev installed locally.
It reproduces at Rails CI environment that runs Ruby using Docker.
https://buildkite.com/rails/rails/builds/91635#01850c57-922e-4bac-a083-732715667640
```
Installing sqlite3 1.5.4 with native extensions
/usr/local/lib/ruby/3.2.0+3/bundler/installer/parallel_installer.rb:220:in `handle_error': Gem::Ext::BuildError: ERROR: Failed to build gem native extension. (Bundler::InstallError)
current directory: /usr/local/lib/ruby/gems/3.2.0+3/gems/sqlite3-1.5.4/ext/sqlite3
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.2.0+3 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3400000.tar.gz into tmp/x86_64-linux-gnu/ports/sqlite3/3.40.0... OK
Running 'configure' for sqlite3 3.40.0... OK
Running 'compile' for sqlite3 3.40.0... OK
Running 'install' for sqlite3 3.40.0... OK
Activating sqlite3 3.40.0 (from /usr/local/lib/ruby/gems/3.2.0+3/gems/sqlite3-1.5.4/ports/x86_64-linux-gnu/sqlite3/3.40.0)...
Could not configure the build properly (pkg_config). Please install either the `pkg-config` utility or the `pkg-config` rubygem.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
```
Related to https://github.com/rails/rails/pull/46711
This commit addresses these failures.
- `bundle install` failure
```ruby
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Could not find gem 'digest (~> 3.0.1.pre)' in rubygems repository https://rubygems.org/ or installed locally.
The source contains the following versions of 'digest': 1.0.0, 3.0.0, 3.1.0.pre0, 3.1.0.pre1, 3.1.0.pre2, 3.1.0.pre2 java
$
```
* Action Mailbox bug report template failures
```ruby
$ cd guides/bug_report_templates
$ ruby -v
ruby 3.1.0dev (2021-10-12T11:53:18Z master 58ae1efb49) [x86_64-linux]
$ ruby action_mailbox_main.rb
Fetching gem metadata from https://rubygems.org/......
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:278:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'digest (~> 3.0.1.pre)' in rubygems repository https://rubygems.org/ or installed locally. (Bundler::GemNotFound)
The source contains the following versions of 'digest': 1.0.0, 3.0.0, 3.1.0.pre0, 3.1.0.pre1, 3.1.0.pre2, 3.1.0.pre2 java
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:253:in `each'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:253:in `verify_gemfile_dependencies_are_found!'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:50:in `start'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/resolver.rb:23:in `resolve'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/definition.rb:267:in `resolve'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/definition.rb:183:in `resolve_remotely!'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:280:in `resolve_if_needed'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:82:in `block in run'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:12:in `block in lock'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:9:in `open'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/process_lock.rb:9:in `lock'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:71:in `run'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer.rb:23:in `install'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:63:in `block (2 levels) in gemfile'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:62:in `block in gemfile'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:55:in `gemfile'
from action_mailbox_main.rb:5:in `<main>'
$
```
Refer e94bcda025
This commit addresses CI failure since https://buildkite.com/rails/rails/builds/81642#ee889e34-4f2f-4bb6-9204-9c9bd0d27fa8
`net-smtp` gem v0.2.2 released which adds dependency to digest gem which attempts to install digest 3.0.0.
However, Ruby 3.1.0dev requires digest gem 3.0.1, which causes this failure.
Refer
https://github.com/ruby/net-smtp/releases/tag/v0.2.2b1adc9e0be
- Steps to reproduce
```
$ cd guides/bug_report_templates
$ ruby action_mailbox_main.rb
- Result without this commit
```ruby
$ ruby -v
ruby 3.1.0dev (2021-10-10T15:24:09Z master 10c650628a) [x86_64-linux]
$ cd guides/bug_report_templates
$ ruby action_mailbox_main.rb
Fetching gem metadata from https://rubygems.org/......
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using minitest 5.14.4
Using builder 3.2.4
Using erubi 1.10.0
Using mini_mime 1.1.1
Using bundler 2.3.0.dev
Using rack 2.2.3
Using digest 3.0.0
Using io-wait 0.1.1
Using method_source 1.0.0
Using timeout 0.1.1
Using thor 1.1.0
Using zeitwerk 2.5.0.beta5
Using sqlite3 1.4.2
Using i18n 1.8.10
Using tzinfo 2.0.4
Using mail 2.7.1
Using marcel 1.0.2
Using rack-test 1.1.0
Using net-protocol 0.1.1
Using sprockets 4.0.2
Using activesupport 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using websocket-extensions 0.1.5
Using net-smtp 0.2.2
Using websocket-driver 0.7.5
Using crass 1.0.6
Using nio4r 2.5.8
Using racc 1.5.2
Using mini_portile2 2.6.1
Using nokogiri 1.12.5
Using loofah 2.12.0
Using rails-html-sanitizer 1.4.2
Using rails-dom-testing 2.0.3
Using globalid 0.5.2
Using actionview 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activemodel 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionpack 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activejob 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actioncable 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionmailer 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using sprockets-rails 3.2.2
Using activerecord 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using railties 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using activestorage 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actiontext 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using actionmailbox 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
Using rails 7.0.0.alpha2 from https://github.com/rails/rails.git (at /home/yahonda/src/github.com/rails/rails@5e1a039)
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated digest 3.0.1.pre, but your Gemfile requires digest 3.0.0. Since digest is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports digest as a default gem. (Gem::LoadError)
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:25:in `block in setup'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:24:in `map'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/runtime.rb:24:in `setup'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:71:in `block in gemfile'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/inline.rb:55:in `gemfile'
from action_mailbox_main.rb:5:in `<main>'
$
```
Ruby 3.1 extracts some gems to bundled one, which requires to add these gems to Gemfile explicitly.
`net/smtp` is one of them, which affected Action Mailbox bug report templates.
* Steps to reproduce
Install `ruby 3.1.0dev`
```
git clone https://github.com/rails/rails.git
cd rails/guides
ruby bug_report_templates/action_mailbox_gem.rb
ruby bug_report_templates/action_mailbox_main.rb
```
* This commit addresses the following error `cannot load such file -- net/smtp (LoadError)`
```
$ ruby bug_report_templates/action_mailbox_gem.rb
... snip ...
Using rails 6.1.0
/home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require': cannot load such file -- net/smtp (LoadError)
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:9:in `<module:Mail>'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:3:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/mail_ext.rb:3:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox.rb:3:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/engine.rb:9:in `<top (required)>'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require'
from bug_report_templates/action_mailbox_gem.rb:17:in `<main>'
```
* Added comment when this dependency can be removed based on https://bugs.ruby-lang.org/issues/17873
Refer
https://github.com/ruby/ruby/pull/4530https://github.com/rails/rails/pull/42308
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Migration version references has been updated 2 times in less than 3
weeks (#41894, #42113).
I'd not want to receive the same tweaks in the near future.
Given that Bundler 1.10 was released back in 2015, we can assume
that people are at least on this version or a higher one so there
is no need to ask people to upgrade.
Also, given that Rails 5.0 supports Ruby 2.2+ and given that this
version come with Minitest 5.4.3 bundled, we don't need to ensure
backward compatibility with Minitest 4.
The name of the minitest library is spelled that way: regular font, and
lowercase. Lowercase is used even at the beginning of sentences, see
http://docs.seattlerb.org/minitest/
I double-checked this with @zenspider too (thanks!).