RubyMine: Load Path - Require Error

Answered

Forgive my inexperience but I am unable to run a file within a third-party project with the following structure:

˅ alpha (project)
   ˅ lib (load path root)
      ˅ bravo
         golf.rb
      ˅ charlie
         ˃ delta
            ˅ echo
               foxtrot.rb
               require "charlie/delta/echo/__init"
               __init.rb
               require "bravo/golf"

which generates the following error:
"'require': cannot load such file -- charlie/delta/echo/__init (LoadError)"

Why is setting the 'load path root' to lib not resolving the require imports and what corrections do I need to make to run foxtrot.rb?

Please advise?

1 comment
Comment actions Permalink

As we've discussed in the support ticket in your project `require` (with the current path) won't work (the same behaviour is in case the script is run manually from the command line). The current load path in RubyMine is used for code completion: https://www.jetbrains.com/help/ruby/configuring-load-path.html

Your proposal for adding the possibility to mark certain folders as project's load path (for `require`) is a bit complicated as a task but you're welcome to submit it directly on our tracker as a feature request: https://youtrack.jetbrains.com/issues/RUBY

0

Please sign in to leave a comment.