environment.rb GEM_PATH -- problem deploying to shared host

I'm a long time listener, first time caller -- this is the first time
I've deployed a rails app to a shared host so please bear with me.
I've gotten all my GEM_PATH variables set up in .bash_profile, .gemrc,
etc. and everything seems to be working. I can require all the
necessary gems from the ruby console, but when I try to launch the
application it fails to find the gems installed in the local user
directory.

It seems the issue must be in environment.rb, where I've tried a half-
dozen different approaches to set my GEM_PATH but without any luck.
After much searching around on google I still don't feel like I have a
good handle on exactly how environment.rb works / should be used.

I've been banging my head on the wall here for a while, so any and all
help is greatly appreciated!

Here are the details:

# mongrel.log

You'll need to set GEM_PATH a lot earlier than environment.rb to have
it work - that file is loaded by the Rails initializer, which (in your
environment) appears to be coming from an installed gem. You'll want
to put the setting in either .bashrc (which is loaded for non-
interactive shells on some systems) or the Mongrel config someplace.
Settings in .bash_profile are typically only added when running an
actual login shell.

--Matt Jones

Matt Jones wrote:

You'll need to set GEM_PATH a lot earlier than environment.rb to have
it work - that file is loaded by the Rails initializer, which (in your
environment) appears to be coming from an installed gem. You'll want
to put the setting in either .bashrc (which is loaded for non-
interactive shells on some systems) or the Mongrel config someplace.
Settings in .bash_profile are typically only added when running an
actual login shell.

--Matt Jones

My .bashrc doesn't get run as the server starts. I've tried placing the
GEM_PATH and GEM_HOME in the dispatcher, but I still see the same
problem: gems required by my app are not being found. No search is made
of the local path. Where would you guys suggest placing the assignment
to ENV['GEM_PATH'] (and GEM_HOME)?

  Ron

Thanks for the help Matt, I gave the .bashrc solution a try but
without any luck -- it must not be loading on their system. As for
the mongrel config solution -- which file? Can this be solved with a
mongrel_cluster.yml inside the application folder?

-Danny

Nope - also too late. It would have to be set before the mongrels
start; I'm not sure where that would be.

The other option would be to switch to the Rubygems standard location
of ~/.gem - that will be picked up automatically.

--Matt Jones