title: Check if URL exists in Ruby
body: <p>How would I go about checking if a URL exists using Ruby?</p>
  
  <p>For example, for the URL</p>
  
  <pre><code>https://google.com
  </code></pre>
  
  <p>the result should be <em>truthy</em>, but for the URLs</p>
  
  <pre><code>https://no.such.domain
  </code></pre>
  
  <p>or</p>
  
  <pre><code>https://stackoverflow.com/no/such/path
  </code></pre>
  
  <p>the result should be <em>falsey</em></p>