title: How do I tell bundle install to use the version of Ruby on my PATH?
body: <p>I'm trying to install my Rails 5 project on Debian. Either running <code>bundle install</code> with or without <code>sudo</code> results in an error complaining about not having the appropriate version of Ruby, even though when I run <code>ruby -v</code> after, you can see the version is 2.4. How do I point <code>bundle install</code> to the right version?</p>
  
  <pre><code>$ sudo bundle install
  [sudo] password for myuser:
  Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
  Your Gemfile lists the gem jquery-rails (&gt;= 0) more than once.
  You should probably keep only one of them.
  While it's not a problem now, it could cause errors if you change the version of just one of them later.
  Fetching gem metadata from https://rubygems.org/........
  Fetching additional metadata from https://rubygems.org/..
  Using rake 12.0.0
  Using concurrent-ruby 1.0.5
  Using i18n 0.8.6
  Using minitest 5.10.3
  Using thread_safe 0.3.6
  Using tzinfo 1.2.3
  
  Gem::InstallError: activesupport requires Ruby version &gt;= 2.2.2.
  An error occurred while installing activesupport (5.0.4), and Bundler cannot continue.
  Make sure that `gem install activesupport -v '5.0.4'` succeeds before bundling.
  
  $ ruby -v
  ruby 2.4.0p0 (2016-12-24 revision 57164) [armv6l-linux-eabihf]
  </code></pre>
  
  <p>Running without <code>sudo</code>:</p>
  
  <pre><code>$ bundle install
  Your Gemfile lists the gem jquery-rails (&gt;= 0) more than once.
  You should probably keep only one of them.
  While it's not a problem now, it could cause errors if you change the version of just one of them later.
  Fetching gem metadata from https://rubygems.org/........
  Fetching additional metadata from https://rubygems.org/..
  Using rake 12.0.0
  Using concurrent-ruby 1.0.5
  Using i18n 0.8.6
  Using minitest 5.10.3
  Using thread_safe 0.3.6
  Using tzinfo 1.2.3
  
  Gem::InstallError: activesupport requires Ruby version &gt;= 2.2.2.
  An error occurred while installing activesupport (5.0.4), and Bundler cannot continue.
  Make sure that `gem install activesupport -v '5.0.4'` succeeds before bundling.
  
  $ ruby -v
  ruby 2.4.0p0 (2016-12-24 revision 57164) [armv6l-linux-eabihf]
  </code></pre>