-
-
Save sixtyfive/0f1aaed94bb86ddf7177f8fa9b52b842 to your computer and use it in GitHub Desktop.
problem understanding how to use Pathname
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this be blah/blah.rb | |
# there also be lib/foobar.rb | |
require 'pathname' | |
ROOT = Pathname(__FILE__).dirname.parent | |
require_relative ROOT + 'lib' + 'foobar' | |
# the above doesn't work saying: | |
# blah/blah.rb:7:in `require_relative': cannot load such file -- /home/jrs/Projects/test/blah/lib/foobar.rb (LoadError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment