After long periods of inactivity, I've been receiving a similar error for a couple of Sinatra applications on a DreamHost VPS:
Phusion Passenger Error: You have activated rack 1.2.1, but your Gemfile requires rack 1.3.0.
Like how @aren55555 described, if you simply refresh the page, the error goes away. Here is something that I discovered about the server configuration:
[psXXXXX]$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/XXXXXXXXX/.gems/
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /home/XXXXXXXXX/.gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/XXXXXXXXX/.gems/ <-- Rack 1.3.0 Gem was installed here
- /usr/lib/ruby/gems/1.8 <-- Rack 1.2.1 Gem was installed here
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
My guess as to what was happening is, after Passenger "wakes up", for some reason it's looking first (or perhaps only) to the Gems at the system-level, selecting Rack 1.2.1 as the latest version. My short-term hacky solution was simply to install Rack 1.3.0 there:
gem install rack -v 1.3.0 --install-dir /usr/lib/ruby/gems/1.8
It seems to have worked. Hope this is helpful to anyone else tearing their hair out there.