On Mon, Apr 11, 2011 at 7:55 AM, Albert Schlef <albertschlef / gmail.com>wrote:

> Phillip Gawlowski wrote in post #992098:
> > Ruby 1.9 expects* you to use
> >
> > require_relative "path/to/file_sans_rb"
> >
> > if you want to require something you wrote yourself.
>
> My Ruby 1.9 doesn't have a "require_relative" method.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
The alternative is:
require "#{File.dirname __FILE__}/path/to/file_sans_rb"

I usually use this, because require_relative is so new (and undocumented)

Though someone on IRC suggest that if you do this, then you're doing
something wrong, your environment should be set up to prevent this from
being necessary (I assume they mean for libs and projects, not necessarily
for 1 off scripts).