Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential incompatibility with Rake 13.2.x? #108

Closed
moneill opened this issue Apr 8, 2024 · 1 comment · Fixed by #109
Closed

Potential incompatibility with Rake 13.2.x? #108

moneill opened this issue Apr 8, 2024 · 1 comment · Fixed by #109

Comments

@moneill
Copy link

moneill commented Apr 8, 2024

Hi there!

After updating my Rails 7 app from Rake v13.1.0 to v13.2.1, I now encounter the following exception when attempting to boot Rails:

/Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/timezone-1.3.25/lib/timezone/lookup.rb:61:in `initialize': uninitialized constant Timezone::Lookup::OptionSetter::OpenStruct (NameError)
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/timezone-1.3.25/lib/timezone/lookup.rb:33:in `new'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/timezone-1.3.25/lib/timezone/lookup.rb:33:in `config'
	from /Users/<username>/Development/<repo>/config/initializers/timezone.rb:1:in `<main>'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:690:in `load'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:690:in `block in load_config_initializer'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/activesupport-7.1.3.2/lib/active_support/notifications.rb:208:in `instrument'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:689:in `load_config_initializer'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:643:in `block (2 levels) in <class:Engine>'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:642:in `each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/engine.rb:642:in `block in <class:Engine>'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:32:in `instance_exec'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:32:in `run'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:231:in `block in tsort_each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:353:in `block (2 levels) in each_strongly_connected_component'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:425:in `block (2 levels) in each_strongly_connected_component_from'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:434:in `each_strongly_connected_component_from'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:424:in `block in each_strongly_connected_component_from'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:50:in `each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:418:in `call'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:418:in `each_strongly_connected_component_from'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:352:in `block in each_strongly_connected_component'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:350:in `each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:350:in `call'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:350:in `each_strongly_connected_component'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:229:in `tsort_each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tsort.rb:208:in `tsort_each'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:60:in `run_initializers'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/rails/application.rb:426:in `initialize!'
	from /Users/<username>/Development/<repo>/config/environment.rb:5:in `<main>'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/spring-4.1.3/lib/spring/application.rb:107:in `preload'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/spring-4.1.3/lib/spring/application.rb:166:in `serve'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/spring-4.1.3/lib/spring/application.rb:148:in `block in run'
	from <internal:kernel>:187:in `loop'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/spring-4.1.3/lib/spring/application.rb:142:in `run'
	from /Users/<username>/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/spring-4.1.3/lib/spring/application/boot.rb:19:in `<top (required)>'
	from <internal:/Users/<username>/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/Users/<username>/.rbenv/versions/3.3.0/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from -e:1:in `<main>'

Here's the contents of config/initializers/timezone.rb:

Timezone::Lookup.config(:geonames) do |c|
  c.username = "<geonames username>"
end

I wonder if this change that's part of v13.2.0 is potentially related? Use Struct instead of OpenStruct. #545

@panthomakos
Copy link
Owner

Looks like OpenStruct was removed. To retain backwards compatibility I will release a new patch update with ostruct included.

panthomakos added a commit that referenced this issue Apr 30, 2024
Also upgrade RuboCop and some formatting to fix errors.

Fixes #108
panthomakos added a commit that referenced this issue Apr 30, 2024
Also upgrade RuboCop and some formatting to fix errors.

Fixes #108
panthomakos added a commit that referenced this issue Apr 30, 2024
Also upgrade RuboCop and some formatting to fix errors.

Fixes #108
panthomakos added a commit that referenced this issue Apr 30, 2024
Also upgrade RuboCop and some formatting to fix errors.

Fixes #108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants