How to point Passenger to the correct Gem files when using RVM Gemsets on Ubuntu? Bundler::GemNotFound

hostingphusion-passengerruby-on-railsrvmubuntu-10.04

I have a Ubuntu server (10.04) with nginx, and Passenger. I've installed RVM on it, and I have a global gemset with Passenger 3.02 installed. My application is within another gemset which has rails, etc installed. When I configure nginx to serve the application I get an error saying that Bundler cannot find the gem.

Could not find abstract-1.0.0 in any of the sources (Bundler::GemNotFound)

Running rvm info I see the following:

environment:
PATH: "/home/richard/.rvm/gems/ree-1.8.7-2010.02@richarddowden.com/bin:/home/richard/.rvm/gems/ree-1.8.7-2010.02@global/bin:/home/richard/.rvm/rubies/ree-1.8.7-2010.02/bin:/home/richard/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME:     "/home/richard/.rvm/gems/ree-1.8.7-2010.02@richarddowden"
GEM_PATH:     "/home/richard/.rvm/gems/ree-1.8.7-2010.02@richarddowden:/home/richard/.rvm/gems/ree-1.8.7-2010.02@global"
MY_RUBY_HOME: "/home/richard/.rvm/rubies/ree-1.8.7-2010.02"
IRBRC:        "/home/richard/.rvm/rubies/ree-1.8.7-2010.02/.irbrc"
RUBYOPT:      ""
gemset:       "richarddowden"

and in my (global) nginx conf file I have the following:

http {
passenger_root /home/richard/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-3.0.2;
passenger_ruby /home/richard/.rvm/wrappers/ree-1.8.7-2010.02@global/ruby;

What daft thing am I doing wrong? Do I need to duplicate the passenger_ruby variable in the application's nginx config file?

Thanks,
Richard

Best Answer

Palm -> Face...

http://dalibornasevic.com/posts/21-rvm-and-passenger-setup-for-rails-2-and-rails-3-apps

&

http://rvm.beginrescueend.com/integration/passenger/

Still hoping for tighter integration between these two in future releases though. Deployment with Rails (outside of Heroku) is still tricky for the newcomer.