title: How to create a file in Ruby
body: <p>I'm trying to create a new file and things don't seem to be working as I expect them too. Here's what I've tried:</p>
  
  <pre><code>File.new "out.txt"
  File.open "out.txt"
  File.new "out.txt","w"
  File.open "out.txt","w"
  </code></pre>
  
  <p>According to everything I've read online all of those should work but every single one of them gives me this:</p>
  
  <pre><code>ERRNO::ENOENT: No such file or directory - out.txt
  </code></pre>
  
  <p>This happens from IRB as well as a Ruby script. What am I missing?</p>