I am working on a little gem in Netbeans to relearn Ruby and JRuby and
am having path issues between Netbeans and running it in the CL.
$LOAD_PATH in netbeans gives
/home/david/projects/http-proxy/lib-I/home/david/projects/http-proxy/spec
/home/david/apps/jruby/lib/ruby/site_ruby/1.9
/home/david/apps/jruby/lib/ruby/shared
/home/david/apps/jruby/lib/ruby/1.9
in CL it is
/home/david/apps/jruby/lib/ruby/site_ruby/1.9
/home/david/apps/jruby/lib/ruby/shared
/home/david/apps/jruby/lib/ruby/1.9
Using require_relative works for both, but I don’t recall ever having to
use that method.
Using require and actually not getting errors back requires this ugly
hack
unless Dir.exists? “#{Dir.pwd}/lib”
$LOAD_PATH << “#{Dir.pwd}”
else
$LOAD_PATH << “#{Dir.pwd}/lib”
end
I don’t remember ever having to set $LOAD_PATH for either Ruby or JRuby.
Is there a better way to require files in the gem?