After updating to Big Sur, my ruby (2.6.3) on rails (5.2.1) application repeatedly has LoadError when running rails s
or rails db:migrate
.
I have tried uninstall and reinstall rails multiple time but it will only work 1 or 2 times before encountering LoadError again.
Here are some samples of the errors (Note that they are different)
/Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- new_relic/agent/instrumentation/sinatra/transaction_namer (LoadError)
/Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- /Library/Ruby/Gems/2.6.0/gems/newrelic_rpm-6.8.0.360/lib/new_relic/agent/instrumentation/active_merchant.rb (LoadError)
/Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- /Library/Ruby/Gems/2.6.0/gems/newrelic_rpm-6.8.0.360/lib/new_relic/agent/instrumentation/typhoeus.rb (LoadError)
/Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- ffaker/company (LoadError)
Update: currently trying installing rails via rvm to see if this consistent error goes away.
You should not use Apple's Ruby installation. That installation exists solely for internal use by Apple itself.
My guess is that the System Integrity Protection keeps deleting and/or restoring stuff that you changed in the system protected directories.
For more information, see for example