How Do You Troubleshoot the Message “/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require’: cannot load such file — foobar (LoadError)”?

Problem scenario
You are running Vagrant, Ruby or a Ruby application, but you get this error: "/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- foobar (LoadError)"

What should you do?

Possible Solution #1
Try to run the original command with "sudo". If that doesn't work, use "gem list" to verify "foobar" is installed.

For Windows users, try to run the command or application as Administrator.

Possible Solution #2
Run both of these commands:

gem install foobar
sudo gem install foobar

Leave a comment

Your email address will not be published. Required fields are marked *