Skip to content

Conversation

@willnet
Copy link
Collaborator

@willnet willnet commented Apr 25, 2025

単純にRubyのバージョンだけの変更ではうまくいかなかったので差分が比較的多いです。

まずRubyのバージョンを上げてテストを実行したところ、次のようなエラーになりました

/Users/willnet/.rbenv/versions/3.4.3/lib/ruby/gems/3.4.0/gems/minitest-5.16.3/lib/minitest.rb:3:in 'Kernel#require': cannot load such file -- mutex_m (LoadError)

minitestが依存していたmutex_mがbundled gemになった結果このエラーになったと判断し、bundle updateでminitestのバージョンを上げました。

すると今度は次のようなエラーになりました。

/Users/willnet/ghq/github.com/kinoppyd/reading-metaprogramming-ruby/00_setup/test/test_try_out.rb:4:in '<top (required)>': uninitialized constant MiniTest (NameError)

class TestTryOut < MiniTest::Test

これは、"MiniTest"という古い参照の仕方が+ Only load minitest/unit (aka ancient MiniTest compatibility layer) … · minitest/minitest@a2c6c18で消されたのが原因のようです。一括置換で"Minitest"に変更して対応しました。

これでテストが通るようになったので大丈夫なはず。

単純にRubyのバージョンだけの変更ではうまくいかなかったので差分が比較的多いです。

まずRubyのバージョンを上げてテストを実行したところ、次のようなエラーになりました

```
/Users/willnet/.rbenv/versions/3.4.3/lib/ruby/gems/3.4.0/gems/minitest-5.16.3/lib/minitest.rb:3:in 'Kernel#require': cannot load such file -- mutex_m (LoadError)
```

minitestが依存していた[mutex_m](https://github.com/ruby/mutex_m)がbundled gemになった結果このエラーになったと判断し、bundle updateでminitestのバージョンを上げました。

すると今度は次のようなエラーになりました。

```
/Users/willnet/ghq/github.com/kinoppyd/reading-metaprogramming-ruby/00_setup/test/test_try_out.rb:4:in '<top (required)>': uninitialized constant MiniTest (NameError)

class TestTryOut < MiniTest::Test
```

これは、"MiniTest"という古い参照の仕方が[+ Only load minitest/unit (aka ancient MiniTest compatibility layer) … · minitest/minitest@a2c6c18](https://github.com/minitest/minitest/commit/a2c6c18570f6f0a1bf6af70fe3b6d9599a13fdd6)で消されたのが原因のようです。一括置換で"Minitest"に変更して対応しました。

これでテストが通るようになったので大丈夫なはず。
Copy link
Owner

@kinoppyd kinoppyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スクリーンショット 2025-04-25 17 20 03

@willnet willnet merged commit 8c9fd82 into master Apr 25, 2025
1 check passed
@willnet willnet deleted the 3-4-3 branch April 25, 2025 08:31
willnet added a commit that referenced this pull request Apr 25, 2025
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 this pull request may close these issues.

3 participants