Rubymine and RuboCop complain - no such file to load

When using Rubymine with RuboCop in a slightly complex Ruby project, you might occasionally see an error like this which you feel is strange since the path in question is available to your Ruby program since the $LOAD_PATH is changed within the script.

No such file to load

It’s not a very big issue but it is annoying since it affects auto-complete (fails to complete into the included file) and navigation within Rubymine, and prevents RuboCop from helping you and leaves an unncessary warning around.

In Rubymine, the way to handle this is to mark the directory as a Load Path Root. Just right click on the name of the directory and follow the menus down as in the picture below.

That worked for me (in 2020) though some people have said they needed a couple of additional steps.

comments powered by Disqus