rack

"You have already activated rack 1.2.1, but your Gemfile requires rack 1.3.2" = Rails 3.1 + Passenger

Latest release of Ruby on Rails (3.1) moved from rack 1.2.1 to rack 1.3.2, this a very big issue in the real world, because many shared hosting use latest "rack" package from the Linux distribution which is older compared to the rack you can get with "gem install rack".

"You have already activated rack 1.2.1, but your Gemfile requires rack 1.3.2" is the error which Passenger shows.

The weird is that Passenger load the rack gem from the system /usr/lib instead of gem installed in the project (and listed in the Gemfile.lock), but if the Passenger process remains alive sometimes it correctly load the rack gem bundled.

Hacks: cron and wget

I still didn't find a clean solution (please leave a comment if You have one) but with a ping every minute with a cron job helps to reduce the Error 500 occurencies.

/usb/bin/wget -q -O /dev/null http://yourbuggywebsite.com