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

[BUG] i18n 1.9.0 LoadError: cannot load such file -- i18n/core_ext/hash #603

Closed
olleolleolle opened this issue Jan 27, 2022 · 6 comments
Closed

Comments

@olleolleolle
Copy link
Contributor

olleolleolle commented Jan 27, 2022

What I tried to do

See the CI run.

LoadError: cannot load such file -- i18n/core_ext/hash

What I expected to happen

Passing tests.

What actually happened

An error in requires. https://github.com/ruby-i18n/i18n/search?q=core_ext shows that i18n/core_ext/hash is still being required, but is probably removed?

/opt/hostedtoolcache/Ruby/3.0.3/x64/bin/ruby -w -I"lib:lib:test" /home/runner/work/i18n/i18n/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/api/all_features_test.rb" "test/api/cascade_test.rb" "test/api/chain_test.rb" "test/api/fallbacks_test.rb" "test/api/key_value_test.rb" "test/api/memoize_test.rb" "test/api/override_test.rb" "test/api/pluralization_test.rb" "test/api/simple_test.rb" "test/backend/cache_file_test.rb" "test/backend/cache_test.rb" "test/backend/cascade_test.rb" "test/backend/chain_test.rb" "test/backend/exceptions_test.rb" "test/backend/fallbacks_test.rb" "test/backend/interpolation_compiler_test.rb" "test/backend/key_value_test.rb" "test/backend/memoize_test.rb" "test/backend/metadata_test.rb" "test/backend/pluralization_fallback_test.rb" "test/backend/pluralization_scope_test.rb" "test/backend/pluralization_test.rb" "test/backend/simple_test.rb" "test/backend/transliterator_test.rb" "test/gettext/api_test.rb" "test/gettext/backend_test.rb" "test/i18n/exceptions_test.rb" "test/i18n/gettext_plural_keys_test.rb" "test/i18n/interpolate_test.rb" "test/i18n/load_path_test.rb" "test/i18n/middleware_test.rb" "test/i18n_test.rb" "test/locale/fallbacks_test.rb" "test/locale/tag/rfc4646_test.rb" "test/locale/tag/simple_test.rb" "test/utils_test.rb" 
test_declarative is deprecated for Minitest::Unit::TestCase
test_declarative is deprecated for Minitest::Test
/home/runner/work/i18n/i18n/test/backend/cache_test.rb:65: warning: assigned but unused variable - cache_key
Skipping cache tests using ActiveSupport
/home/runner/work/i18n/i18n/lib/i18n/backend/chain.rb:3:in `require': cannot load such file -- i18n/core_ext/hash (LoadError)
	from /home/runner/work/i18n/i18n/lib/i18n/backend/chain.rb:3:in `<top (required)>'
	from /home/runner/work/i18n/i18n/test/backend/chain_test.rb:2:in `require'
	from /home/runner/work/i18n/i18n/test/backend/chain_test.rb:2:in `<top (required)>'
	from /home/runner/work/i18n/i18n/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:21:in `require'
	from /home/runner/work/i18n/i18n/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:21:in `block in <main>'
	from /home/runner/work/i18n/i18n/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:6:in `select'
	from /home/runner/work/i18n/i18n/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:6:in `<main>'
not testing with Cache enabled because active_support can not be found

Versions of i18n, rails, and anything else you think is necessary

Affected: v1.9.0, which was just released.

Update: #602 makes CI green again.

Workaround is simple: in the Gemfile, avoid installing latest release.

gem "i18n", "< 1.9.0"

See the CI output.

In addition, radar just did a greatly reduced the outstanding triage work on this repository. Kudos!

@schinery
Copy link

schinery commented Jan 27, 2022

Looks like there is a PR to revert the breaking change - #603

@olleolleolle
Copy link
Contributor Author

Right, #602 is the Pull Request.

@schinery
Copy link

schinery commented Jan 27, 2022

Meant #602 (not yet had coffee) 🤦🏻‍♂️

@mpantel
Copy link

mpantel commented Jan 27, 2022

Actually this #573 (comment) might be the problem cause...

mpantel added a commit to mpantel/i18n that referenced this issue Jan 27, 2022
@radar
Copy link
Collaborator

radar commented Jan 27, 2022

I am sorry for stuffing this one up. Clearly #602 should've been merged and I should've looked at the right GH actions build, not the one before the latest.

I've yanked 1.9.0, and have now pushed 1.9.1.

@radar radar closed this as completed Jan 27, 2022
thomasleese added a commit to ministryofjustice/hmpps-book-secure-move-api that referenced this issue Jan 28, 2022
The version 1.9.0 was yanked due to a bug: ruby-i18n/i18n#603
thomasleese added a commit to ministryofjustice/hmpps-book-secure-move-api that referenced this issue Jan 28, 2022
The version 1.9.0 was yanked due to a bug: ruby-i18n/i18n#603
shouichi added a commit to anipos/zengin-code-rails that referenced this issue Feb 1, 2022
Because v1.9.0 has been yanked.
ruby-i18n/i18n#603 (comment)
anipos-bulldozer bot pushed a commit to anipos/zengin-code-rails that referenced this issue Feb 1, 2022
@pboling
Copy link

pboling commented Feb 25, 2022

For anyone using tools that give this error (e.g. chewy v5)

LoadError: cannot load such file -- i18n/core_ext/hash

A potential fix is to create a file relative to a load path of the project (which may require forking it) at i18n/core_ext/hash.rb and then have a single line in the file:

require 'active_support/core_ext/hash/keys'

... which will also require adding activesupport as a dependency, if it wasn't already.

See: toptal/chewy#834

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

No branches or pull requests

5 participants