title: Phusion Passenger Error: You have activated rack 1.2.1, but your Gemfile requires rack 1.2.2
body: <p>I'm trying to run a Ruby on Rails app on a Dreamhost shared server. All is well so far except one weird bug I have not been able to unravel.</p>
  
  <p>Sometimes when I visit the web app, I get presented with a Phusion Passenger error saying, </p>
  
  <blockquote>
    <p>You have already activated rack 1.2.1, but your Gemfile requires rack 1.2.2. Consider using bundle exec.</p>
  </blockquote>
  
  <p>When I just refresh the page it seems to work, though - no more Phusion Passenger error message.</p>
  
  <p>Following other stack overflow threads and a similar <a href="http://wiki.dreamhost.com/Ruby_on_Rails#Rails_2.3.5_-_Rack_1.0_already_activated_.28fix.29" rel="noreferrer">Dreamhost wiki</a>, I added the following to the top of the <code>config/environment.rb</code> file:</p>
  
  <pre><code>if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
    ENV['GEM_PATH'] = '/home/myusername/.gems' + ':/usr/lib/ruby/gems/1.8'
  end
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/jOBcU.png" alt="enter image description here"></p>