Search code examples
ruby-on-railspassengerbundlerrbenv

Bundler and Passenger are out of sync on Rails project


I finally got my apache server running after my upgrade to El Capitan trashed my config files. I had to install the latest version of Phusion Passenger to get it running. When I brought up one of my sites, it complained of a missing gem. I took the nuclear approach and ran bundler update, which installed and number of gems. Bundler check was happy, but Passenger wasn't. I then installed the specific gem with the version number specified. I had to do this for about 20 gems. The site finally came up and worked.

I then switched to another site and had the same problem. I didn't want to load another 20 gems. Bundler was also happy with this project. It appears that bundler is looking at my ruby 2.0.0 gem set while Passenger is looking at my 2.2.0 set. When I run rbenv local I get 2.2.0. Passenger is complaining that minitest-4.7.5 is missing and indeed it is not in the 2.2.0 gem set:

/Users/curt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems

It is in:

/Users/curt/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems

How do I get bundler to look in the right place?


Solution

  • I was able to fix the problem by adding

    PassengerUser myid
    

    to the httpd.conf file. I had it in there before but commented it out when I pasted in the new passenger info. If you see a message in the passenger error page that says your app is being run as the "_unknown" user then you need to add your id as above.

    The first attempt at a fix worked because when I added a missing gem, it did so with the same id under which passenger or apache was running.