title: Phusion Passenger error with Rails 4 and ruby 2.5
body: <pre><code>Ubuntu 16.04
  Rails 4.2.10
  Ruby 2.5.0
  SERVER_SOFTWARE = Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.2.2
  </code></pre>
  
  <p>I installed ruby using rbenv, and when I do</p>
  
  <pre><code>ruby -v
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
  </code></pre>
  
  <p>I installed Phusion Passenger as follows:</p>
  
  <pre><code>sudo apt-get install -y dirmngr gnupg
  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
  sudo apt-get install -y apt-transport-https ca-certificates
  sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main &gt; /etc/apt/sources.list.d/passenger.list'
  sudo apt-get update
  sudo apt-get install -y libapache2-mod-passenger
  sudo a2enmod passenger
  sudo apache2ctl restart
  </code></pre>
  
  <p>When I do:</p>
  
  <pre><code>sudo /usr/bin/passenger-config validate-install
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code> * Checking whether this Passenger install is in PATH... ✓
   * Checking whether there are no other Passenger installations... ✓
   Everything looks good. :-)
  </code></pre>
  
  <p>However, when I try to start my application, I get an error message:</p>
  
  <pre><code>Web application could not be started
  Web application could not be started by the Phusion Passenger application server.
  </code></pre>
  
  <p>From the /var/log/apache2/error.log, I get:</p>
  
  <pre><code>Error ID: d8f774a0
  Error details saved to: /tmp/passenger-error-ShCphj.html
  Message from application: cannot load such file -- bundler/setup (LoadError)
  /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:456:in `activate_gem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:323:in `block in run_load_path_setup_code'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:461:in `running_bundler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:322:in `run_load_path_setup_code'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `&lt;module:App&gt;'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `&lt;module:PhusionPassenger&gt;'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `&lt;main&gt;'
  </code></pre>
  
  <p>================================</p>
  
  <h1>Answer:</h1>
  
  <p>The answer is to uninstall stand alone Phusion Passenger, and install it as a gem, as follows:</p>
  
  <pre><code>sudo apt-get remove -y passenger libapache2-mod-passenger
  </code></pre>
  
  <p>Then installing the gem</p>
  
  <pre><code>gem install passenger --no-rdoc --no-ri
  passenger-install-apache2-module
  </code></pre>
  
  <p>Follow the install directions</p>