This is an old topic, but maybe someone else could use this info.
below to save a few minutes.
I was having the same problem. Apparently, you have to put:
Gem.clear_paths
after you do "require 'rubygems'". So the full solution is:
---------------------------------
ENV['GEM_HOME'] = '/path/to/my/gems'
ENV['GEM_PATH'] = '/path/to/my/gems:/another/path/if/you/want:/and/
another'
require 'rubygems'
Gem.clear_paths
---------------------------------
Apparently, 'Gem.clear_paths' was being called after a gem or file
load error. A better explanation is here:
http://github.com/FooBarWidget/passenger/commit/a60f262fe38beda161024ee14f4387b2c3c73bdf
That explains why the reload was needed to take care of it. I finally
found the answer based on sbeckeriv's comments on the web.
http://www.google.com/search?q=sbeckeriv+clear_paths
I'm still not sure why this hasn't come up before. Are most people
are just using Rails with Passenger? Or maybe there is a better way of
setting the 'gem_path' in a shared environment for Rack apps?