Roger Pack <rogerpack2005 / gmail.com> writes:
>>> require '../ext/rubyeventmachine'
> => true
>>> require 'eventmachine'
>
> hmm.
> Typically this works.  On my newest machine, however, it errs as above.
> LoadError: no such file to load -- rubyeventmachine
>
> It's trying to load the file that I just required one line above,
> successfully.
>
> I assume this is a bug?

No, it's not, it's just what Ruby does.  Some people would argue that
Ruby should be a bit more helpful here, but once you know the rule,
it's not that big of a deal.

When loading a file with require, Ruby will remember the name of the
file you loaded, and not load it again.  The trick here is, it only
remembers the name you give it, so if you refer to the same file using
a different path, Ruby will load the file a second time.

All of the following will load the same file several times.

,----
| require 'foo.rb'
| require './foo.rb'
| require '../foo/foo.rb'
`----

> the file it is trying to load is '../ext/rubyeventmachine.bundle'
> If I copy that file to the local directory [or sym link it in] then
>>> require 'eventmachine'
> => true
> loads like a charm.
>
> Egh.  Looks like an obscure bug to me.  Might be OS X only, anyway.

Looks like a bad LOADPATH to me.

-- 
Peter Jones [pjones at domain below]
pmade inc. - http://pmade.com