title: rescue inside an each_line code block
body: <p>I'm completely "fresh" to Ruby and coming from a .NET background.</p>
  
  <p>I'm trying to create a really simple rake task to import file with json objects into my database.
  My IDE is raising an error when I'm trying to rescue inside the code block of each_line</p>
  
  <pre><code>File.open('etc/metrics_json.log').each_line do |line|
    metric_hash = JSON.parse(line)
    Metric.create(metric_hash)
    rescue RuntimeError =&gt; e
      puts e.message
  end
  </code></pre>
  
  <p>the error is "syntax error, unexpected keyword_rescue, expecting keyword_end"</p>
  
  <p>what am I doing wrong?</p>