When using passenger with rvm I’ve had some issues with project specific gemsets, where bundler was unable to find the gems. After searching a lot I found out about using the “config/setup_load_paths.rb” file to tell passenger where to locate your gems, but then I had a new issue with rvm trying to use the system ruby instead of the ruby version of my .rvmrc file.
After going to the irc channel, I got some help that help me fixed my problem. The culprit was my rvmrc file.
As I’ve seen on many blog posts the file looked something like this:
rvm use --create [email protected]
The solution was to generate the rvmrc file using rvm itself like this:
rvm --create --rvmrc use [email protected]
The file contents now look like this:
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/[email protected]" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/[email protected]"
else
rvm --create use "[email protected]"
fi
And passenger is able to find my gems without any problems.
Hope this helps you as I spent way too much time with this issue.