title: Ruby Apache CGI Premature end of script headers
body: <p>I'm trying to make a simple redirect work.  I've gotten everything else to work just fine.  For example, this works:</p>
  
  <pre><code>#!/usr/bin/env ruby
  
  puts "Content-type: text/html"
  puts
  puts "&lt;h1&gt;blah&lt;/h1&gt;"
  </code></pre>
  
  <p>But this doesn't work (this is where I get the "Premature end of script headers" error):</p>
  
  <pre><code>#!/usr/bin/env ruby
  
  puts "Status: 302 Found"
  puts "Content-type: text/html"
  puts "Location: http://google.com"
  </code></pre>
  
  <p>All of the other suggestions I've found say it's probably something to do with the <code>#!/usr/bin/env ruby</code> part of the script, but that doesn't make any sense to me since it works with the first example.  Any suggestions?</p>
  
  <p>It seems like Apache is parsing the headers I'm returning from the cgi script.  Is there are way to turn that off?</p>