title: How is Passenger and ruby set up on a shared host?
body: <p>I'm trying to get Ruby on Rails apps working on a shared hosting environment running Passenger.
  (Actually two, one has Ruby 2.4 and the other has Ruby 2.7.)
  I cannot get either to work, as their basic Ruby version is lower than the Passenger version.
  (2.4 - 2.1.6, 2.7 - 2.6.)</p>
  <p>So far I haven't been able to get past the Gemfile loading stage.
  For example, on 2.7, if I remove the ruby version I can 'bundle install'.  (uses 2.5.5) and I get</p>
  <pre><code>Could not find rake-13.0.6 in any of the sources (Bundler::GemNotFound)
  </code></pre>
  <p>with</p>
  <pre><code>/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/spec_set.rb:86:in `block in materialize'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/spec_set.rb:80:in `map!'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/spec_set.rb:80:in `materialize'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/definition.rb:170:in `specs'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/definition.rb:237:in `specs_for'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/definition.rb:226:in `requested_specs'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/runtime.rb:101:in `block in definition_method'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/runtime.rb:20:in `setup'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler.rb:149:in `setup'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/setup.rb:20:in `block in &lt;top (required)&gt;'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/ui/shell.rb:136:in `with_level'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/ui/shell.rb:88:in `silence'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler/setup.rb:20:in `&lt;top (required)&gt;'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/rubygems/core_ext/kernel_require.rb:83:in `require'
  /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/rubygems/core_ext/kernel_require.rb:83:in `require'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/phusion_passenger/loader_shared_helpers.rb:373:in `activate_gem'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/phusion_passenger/loader_shared_helpers.rb:537:in `running_bundler'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/rack-preloader.rb:91:in `preload_app'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in &lt;module:App&gt;'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/phusion_passenger/loader_shared_helpers.rb:390:in `run_block_and_record_step_progress'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `&lt;module:App&gt;'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `&lt;module:PhusionPassenger&gt;'
  /opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `&lt;main&gt;'
  </code></pre>
  <p>in the Backtrace.
  If I put 'ruby 2.7.4' in to Gemfile I can't 'bundle install'!</p>
  <p>So, what is happening?
  How is Passenger working with the .htaccess file (or the one generated by 'Application Manager')?
  How can I ensure all my gems are found by the Passenger version of bundler?  What do I need to know to get this working, basically?!!!
  I've not found any documentation on to set up a shared server.  Is there any?  All I've found is standalone setups so far.
  ARRRGGGHHHH!  It's been over two months!</p>
  <p>Oh yes, here's the bare bones Gemfile generated by the Setup Ruby in cPanel.</p>
  <pre><code>git_source(:github) { |repo| &quot;https://github.com/#{repo}.git&quot; }
  
  # ruby '2.5.5'
  # ruby '2.7.4'
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
  gem 'rails', '~&gt; 6.1.4', '&gt;= 6.1.4.1'
  # Use sqlite3 as the database for Active Record
  # gem 'sqlite3', '~&gt; 1.4'
  gem 'mysql2'
  # Use Puma as the app server
  gem 'puma', '~&gt; 5.0'
  # Use SCSS for stylesheets
  gem 'sass-rails', '&gt;= 6'
  # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
  gem 'webpacker', '~&gt; 5.0'
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
  gem 'turbolinks', '~&gt; 5'
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.7'
  # Use Redis adapter to run Action Cable in production
  # gem 'redis', '~&gt; 4.0'
  # Use Active Model has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use Active Storage variant
  # gem 'image_processing', '~&gt; 1.2'
  
  # Reduces boot times through caching; required in config/boot.rb
  gem 'bootsnap', '&gt;= 1.4.4', require: false
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  end
  
  group :development do
    # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
    gem 'web-console', '&gt;= 4.1.0'
    # Display performance information such as SQL time and flame graphs for each request in your browser.
    # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
    gem 'rack-mini-profiler', '~&gt; 2.0'
    gem 'listen', '~&gt; 3.3'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
  end
  
  group :test do
    # Adds support for Capybara system testing and selenium driver
    gem 'capybara', '&gt;= 3.26'
    gem 'selenium-webdriver'
    # Easy installation and use of web drivers to run system tests with browsers
    gem 'webdrivers'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>