title: bundler using system ruby version instead of downloaded
body: <p>This is a basic question, but I've been banging my head against a wall trying to fix this and I'm stuck.</p>
  <p>I'm cloning a rails project.</p>
  <p>When I run <code>bundle install</code> I get:</p>
  <pre><code>Your Ruby version is 2.6.8, but your Gemfile specified 2.5.5
  </code></pre>
  <p>so I tried to make sure that I'm using the right version using <code>rbenv versions</code>. I get:</p>
  <pre><code>  system
  * 2.5.5 (set by /Users/Mahmoud/dev-reps/non-docker/backend/.ruby-version)
  </code></pre>
  <p>which means that rbenv is using the correct version. Now I run <code>which bundle</code>:</p>
  <pre><code>/usr/local/bin/bundle
  </code></pre>
  <p>which means that bundler is using the system version.</p>
  <p>As for <code>which -a bundle</code> gives:</p>
  <pre><code>/usr/local/bin/bundle
  /usr/bin/bundle
  </code></pre>
  <p>Also when I run <code>which ruby</code> or <code>which -a ruby</code>, I get:</p>
  <pre><code>/usr/bin/ruby
  </code></pre>
  <p>Something I tried though, points to light at the end of the tunnel. When [I try based on this post] this<a href="https://stackoverflow.com/questions/10940736/rbenv-not-changing-ruby-version">1</a>:</p>
  <pre><code>export PATH=&quot;$HOME/.rbenv/bin:$PATH&quot;
  eval &quot;$(rbenv init -)&quot;
  </code></pre>
  <p>and rerun bundle install, it works. The problem though, the change isn't persistent. I close shell and retry, and I'm right where I started</p>
  <p>I've uninstalled and re-installed bundler multiple times after rehashing, etc. but I'm still seeing that rbenv isn't &quot;in control&quot;. It tells me one version is in use, but the fact is that the system version is being used.</p>
  <p><strong>Update</strong></p>
  <p>Based on one of the comments, I uninstalled rbenv and redownloaded. Now after <code>rbenv rehash</code> I get the following when I type <code>which ruby</code>:</p>
  <pre><code>/Users/Mahmoud/.rbenv/shims/ruby
  </code></pre>
  <p>which is perfect. <code>which bundle</code> however gives:</p>
  <pre><code>/usr/local/bin/bundle
  </code></pre>
  <p>so the problem persists. I also tried <code>gem install bundler</code> but still when I type <code>bundle install</code> I'm getting the same problem.</p>
  <p>What am I doing wrong?</p>