title: Errno::EEXIST File Exists error when installing 'ferret' gem from local .gem file
body: <p>I am trying to install the <code>ferret</code> ruby gem on a RHEL zlinux (s390x architecture) machine, and am trying to install a <code>.gem</code> file after <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474724" rel="nofollow">patching it so that it will compile</a>.</p>
  
  <p>But even trying to install the pristine fetched gem, it fails as follows:</p>
  
  <pre><code>[ me@s390x ]$ sudo gem fetch ferret
  Downloaded ferret-0.11.6
  [ me@s390x ]$ sudo gem install -lV ferret-0.11.6.gem 
  Installing gem ferret-0.11.6
  Using local gem /home/rubyusr/rubygems/gems/cache/ferret-0.11.6.gem
  /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
  ERROR:  While executing gem ... (Errno::EEXIST)
      File exists - /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
  </code></pre>
  
  <p>None of the above-mentioned directories or files related to "ferret" existed before running this command. </p>
  
  <p>Also strange is that <code>/home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin</code> is a directory, although maybe that is a normal complaint.</p>
  
  <p>A final complicating factor is when I run the <code>gem</code> command I am actually running a shell script that sets the environment variables for my unusual rubygems directory (I haven't had any problems so far with this set up). Here is my <code>gem</code> shell script:</p>
  
  <pre><code>#!/bin/bash
  
  export GEM_HOME=/home/rubyusr/rubygems/gems
  export GEM_PREFIX=/home/rubyusr/rubygems
  export RUBYLIB=$GEM_PREFIX/lib:/usr/lib/ruby:/usr/lib/ruby/site_ruby:/usr/lib/site_ruby
  export GEM_PATH=$GEM_HOME
  
  OUR_GEM_COMMAND=$GEM_PREFIX/bin/gem
  
  $OUR_GEM_COMMAND $@
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I forgot to add that running the gem install command normally does not seem to result in this error (but ferret fails to compile), with the error:</p>
  
  <pre><code>posh.h:515:4: error: #error POSH cannot determine target CPU
  </code></pre>