title: Capybara Poltergeist IOError: closed stream
body: <p>I am using Capybara for web page scraping. I noticed a problem in which afterwards Poltergeist hangs around in the memory eating system resources. The Poltergeist Github page notes that there is a memory leak issue with Capybara (<a href="https://github.com/teampoltergeist/poltergeist" rel="nofollow">https://github.com/teampoltergeist/poltergeist</a>) and they recommend calling</p>
  
  <pre><code>session.driver.quit
  </code></pre>
  
  <p>That fixes the memory issue for me, but when I want to use Capybara again later I receive the error message:</p>
  
  <pre><code>IOError: closed stream
  </code></pre>
  
  <p>I believe just refreshing the Capybara session will fix this but can't find a public method that allows me to restart with a brand new session. </p>
  
  <p>1) Is there a method that will fix my issue?</p>
  
  <p>2) Is resetting the session the best way of reopening the stream?</p>