Skip to content

Rails 6.1 development.rb undefined method `year' for 1:Integer #37391

@schneems

Description

@schneems

Steps to reproduce

git clone https://github.com/schneems/rails_61_boot_bug
cd rails_61_boot_bug
bundle install
rails c

There is a 1.year in the development.rb file, for some reason the activesupport core extensions aren't yet applied when this file (and other config files) are attempted to be loaded. You can see the commit that introduces the bug here schneems/rails_61_boot_bug@a3d207c

The only other modification I made was

Expected behavior

The app to boot into a console

Actual behavior

An error occurs:

	15: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/railties/lib/rails/engine.rb:612:in `block in <class:Engine>'
	14: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/railties/lib/rails/engine.rb:612:in `each'
	13: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/railties/lib/rails/engine.rb:613:in `block (2 levels) in <class:Engine>'
	12: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/activesupport/lib/active_support/dependencies.rb:324:in `require'
	11: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/activesupport/lib/active_support/dependencies.rb:291:in `load_dependency'
	10: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/activesupport/lib/active_support/dependencies.rb:324:in `block in require'
	 9: from /Users/rschneeman/.gem/ruby/2.6.5/gems/zeitwerk-2.1.10/lib/zeitwerk/kernel.rb:23:in `require'
	 8: from /Users/rschneeman/.gem/ruby/2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	 7: from /Users/rschneeman/.gem/ruby/2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	 6: from /Users/rschneeman/.gem/ruby/2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	 5: from /Users/rschneeman/.gem/ruby/2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	 4: from /Users/rschneeman/.gem/ruby/2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	 3: from /Users/rschneeman/Documents/projects/tmp/boot_bug/config/environments/development.rb:1:in `<main>'
	 2: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/railties/lib/rails/railtie.rb:216:in `configure'
	 1: from /Users/rschneeman/.gem/ruby/2.6.5/bundler/gems/rails-921b55d300fe/railties/lib/rails/railtie.rb:216:in `instance_eval'
/Users/rschneeman/Documents/projects/tmp/boot_bug/config/environments/development.rb:63:in `block in <main>': undefined method `year' for 1:Integer (NoMethodError)

System configuration

Rails version: Master (SHA 921b55d)

Ruby version: 2.6.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions