title: What causes undefined method `dir_mode=' when running bundle install
body: <p>I have revisited a Rails 4.2.11.1 app that has not been touched for 2 months. The app uses CircleCI for deployment. Before, when build was triggered, there were no problems whatsoever. During those two months no changes have been made to the code. When triggering a build and running <code>bundle install --deployment --path vendor/bundle</code>, following errors are returned:</p>
  <pre><code>#!/bin/bash -eo pipefail
  bundle install --deployment --path vendor/bundle
  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.
  /gems/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:152: warning: constant Gem::ConfigMap is deprecated
  Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
  Fetching gem metadata from https://rubygems.org/
  Fetching version metadata from https://rubygems.org/
  Fetching dependency metadata from https://rubygems.org/
  Installing rake 12.3.3
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/rake-12.3.3.gem&quot;:String
  Installing CFPropertyList 2.3.6
  
  NoMethodError: undefined method `dir_mode=' for #&lt;String:0x007f3a884a9100&gt;
  Installing i18n 0.8.6
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/i18n-0.8.6.gem&quot;:String
  Installing minitest 5.14.3
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/minitest-5.14.3.gem&quot;:String
  Installing thread_safe 0.3.6
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/thread_safe-0.3.6.gem&quot;:String
  Installing builder 3.2.4
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/builder-3.2.4.gem&quot;:String
  Installing erubis 2.7.0
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/erubis-2.7.0.gem&quot;:String
  Installing mini_portile2 2.4.0
  
  NoMethodError: undefined method `dir_mode=' for #&lt;String:0x007f3aa040ce78&gt;
  Installing crass 1.0.6
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/crass-1.0.6.gem&quot;:String
  Installing rack 1.6.13
  
  NoMethodError: undefined method `dir_mode=' for &quot;/root/repo/vendor/bundle/ruby/2.3.0/cache/zonebie-0.6.1.gem&quot;:String
  An error occurred while installing rake (12.3.3), and Bundler cannot continue.
  Make sure that `gem install rake -v '12.3.3'` succeeds before bundling.
  
  Exited with code exit status 5
  CircleCI received exit code 5
  
  </code></pre>
  <p>I have no idea what might be causing the issue with <code>NoMethodError</code>. Trieg searching for <code>dir_mode=</code> method but to no avail. I would really appreciate any hints on how to get rid of this problem. Thanks in advance!</p>