Strange Passenger behavior on OS X

I've just spent several days intermittently trying to get a
development rails app working again under passenger on OS X.

I still don't understand what happened.

This app was working fine until a few days ago. All of a sudden it
would fail to initialize. The backtrace in the apache error log
showed that a vendored gem (aws-s3) was not finding something it
needed from a non-vendored gem (mime-types).

The same app would come up find under script/server

After much head-scratching I finally noticed that passenger (which had
been started using a darwinports installed ruby in /opt/local) and
which had the darwinports paths set in the apache configuration, was
spawning daemons using /System/Library/Frameworks/Ruby.framework/Ruby
instead of /opt/local/bin/ruby, and the system installation of ruby
was looking for gems in the wrong place, among other things.

I can't think of anything which I'd done to cause this.

I tried reinstalling the passenger apache module and restarting
apache, but no joy.

I then updated the passenger gem to the latest version, reinstalled
the passenger apache module, and restarted apache, same thing.

Then I rebooted the MacBook and it seems to be working again, but
since I don't know what caused this the first time, I'm not sure it
won't come back.

Does anyone have any insight about this?

Hi Rick,

Well, as I implied, I think it was and is /opt/local/bin/ruby

For some reason it seemed to be ignored.

And just to be perfectly clear that was supposed to be "as I implied,
I think,..." the missing comma changes the sense of the sentence.

It definitely WAS and IS /opt/local/bin/ruby and never changed.