title: Why can't the mime-types gem (unpacked in vendor/gems) be found?
body: <p><em>I'm asking this with the intention of also supplying the answer, since I had a lot of trouble figuring out what was going wrong, and Google wasn't much help - however, since this is StackOverflow, I'm sure that someone will answer it more competently or improve the answer.</em></p>
  
  <p>I needed to upgrade a gem for a rails application that I'm working on, which introduced two new dependencies, one of which is <code>mime-types</code>.  Working locally, I added the following line to <code>config/environment.rb</code>:</p>
  
  <pre><code>config.gem 'mime-types', :version =&gt; '1.17'
  </code></pre>
  
  <p>For deployment on our server, it's necessary for all gem dependencies to be installed in <code>vendor/gems</code>, so I then installed the <code>mime-types</code> gem into the current rvm gemset with:</p>
  
  <pre><code>gem install mime-types --version 1.17
  </code></pre>
  
  <p>... and unpacked a version of that into <code>vendor/gems</code> with:</p>
  
  <pre><code>rake gems:unpack
  rake gems:unpack:dependencies
  </code></pre>
  
  <p>However, after deploying on the server, I found that when <code>rake db:migrate</code> was run, the following error appeared, indicating that the <code>mime-types</code> gem couldn't be found (stack trace partially elided):</p>
  
  <pre><code>no such file to load -- mime-types
  /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
  [...]
  /lib/tasks/misc.rake:4
  /usr/lib/ruby/1.8/rake.rb:636:in `call'
  /usr/lib/ruby/1.8/rake.rb:636:in `execute'
  /usr/lib/ruby/1.8/rake.rb:631:in `each'
  /usr/lib/ruby/1.8/rake.rb:631:in `execute'
  /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
  /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/rake.rb:607:in `invoke_prerequisites'
  /usr/lib/ruby/1.8/rake.rb:604:in `each'
  /usr/lib/ruby/1.8/rake.rb:604:in `invoke_prerequisites'
  /usr/lib/ruby/1.8/rake.rb:596:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
  /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/rake.rb:583:in `invoke'
  /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
  /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2029:in `each'
  /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2001:in `run'
  /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /usr/lib/ruby/1.8/rake.rb:1998:in `run'
  /usr/bin/rake:28
  no such file to load -- mime-types
  /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
  [...]
  /lib/tasks/misc.rake:4
  /usr/lib/ruby/1.8/rake.rb:636:in `call'
  /usr/lib/ruby/1.8/rake.rb:636:in `execute'
  /usr/lib/ruby/1.8/rake.rb:631:in `each'
  /usr/lib/ruby/1.8/rake.rb:631:in `execute'
  /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
  /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/rake.rb:607:in `invoke_prerequisites'
  /usr/lib/ruby/1.8/rake.rb:604:in `each'
  /usr/lib/ruby/1.8/rake.rb:604:in `invoke_prerequisites'
  /usr/lib/ruby/1.8/rake.rb:596:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
  /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
  /usr/lib/ruby/1.8/rake.rb:583:in `invoke'
  /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
  /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2029:in `each'
  /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
  /usr/lib/ruby/1.8/rake.rb:2001:in `run'
  /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /usr/lib/ruby/1.8/rake.rb:1998:in `run'
  /usr/bin/rake:28
  Missing these required gems:
    mime-types = 1.17
  
  You're running:
    ruby 1.8.7.302 at /usr/bin/ruby1.8
    rubygems 1.3.7 at /home/mark/.gem/ruby/1.8, /var/lib/gems/1.8
  
  Run `rake gems:install` to install the missing gems.
  </code></pre>
  
  <p>However, <code>mime-types</code> was present in <code>vendor/gems/mime-types-1.17</code>.  Why doesn't rake think that the gem is installed in this case?</p>