'Rails `require': cannot load such file -- matrix

after updating to ruby 3.1.2 and Rails 7.0.2.3

getting following error while starting rails application:

`require': cannot load such file -- matrix (LoadError)

what could be the possible solution, thanks in advance.



Solution 1:[1]

I came onto this issue as well when upgrading Rails 6->7 and Ruby 3.0.0->3.1.2.

For my case the issue was related to Capybara gem. Version 3.35.3 assumed it is installed by default with Ruby. When I upgraded the Capybara to version 3.37.1 then matrix gem was automatically installed as well and the issue was resolved.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andres