title: Use Distributed Cache - HIVE STREAMING
body: <p>I would like to zip the files of a Ruby gem, and distribute them to my EMR cluster.  I would also like to use a simple Ruby script that references the files in this this gem in a Hive Streaming job.     </p>
  
  <p>I add both the file and the archive to the Hadoop Distributed Cache using: </p>
  
  <pre><code>ADD FILE /home/user/mobile.rb; 
  ADD ARCHIVE /home/user/browser-master.zip;
  </code></pre>
  
  <p>Inside mobile.rb, I am using the code below to simulate using the gem:  </p>
  
  <pre><code>$.push File.expand_path("../browser-master/lib", __FILE__)
  require "browser"
  </code></pre>
  
  <p>When I have the unzipped archive and the mobile.rb file in the same dir on my local machine, I can stream data to it and run the program just fine.  </p>
  
  <p>But when I add the files to my Hadoop cluster I get this error:  </p>
  
  <pre><code>FAILED: Execution Error, return code 20003 from org.apache.hadoop.hive.ql.exec.MapRedTask. An error occurred when trying to close the Operator running your custom script.  
  </code></pre>
  
  <p>Does my mobile.rb need to point to something else when the archive is unzipped in the Distributed Cache?</p>
  
  <p>I am using Hive 0.11.</p>