Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to eliminate RubyMine false "No such file to load" errors

Tags:

rubymine

I've recently installed RubyMine on a second machine and cloned a GitHub repository there.

My application runs exactly the same as on the first machine, but the RM code inspection result is radically different: I get dozens of "No such file to load" errors.

This even though the application runs fine both from the command line and from RM.

In dialog Run/Debug Configurations, I have specified load paths (-I. -I..) in the Ruby arguments.

Does the code inspection not honor the configuration? Or perhaps it's using a different configuration?

like image 831
Burdette Lamar Avatar asked Mar 13 '15 18:03

Burdette Lamar


2 Answers

A bit late, but you may need to mark the directories that are load path roots in your app within the Rubymine tree - right click and do "Mark Directory As/Load Path Root".

like image 138
Rich Avatar answered Jan 01 '23 01:01

Rich


For me the other solutions did not work. However, the problem was that RubyMine detected the wrong ruby version - while rvm for the project was ruby 2.4.1, in RubyMine it defaulted to the last version it had (2.4.2). So going to RubyMine > Preferences > Ruby SDK & Gems and changing the version for the project to the correct one solved it.

like image 23
Moshisho Avatar answered Jan 01 '23 00:01

Moshisho