title: No such file or directory?
body: <p>Ruby is giving me this error:</p>
  
  <pre><code>C:/Ruby/new.rb:11:in `read': No such file or directory - m.txt (Errno::ENOENT)
      from C:/Ruby/new.rb:11:in `&lt;main&gt;'
  </code></pre>
  
  <p>But I'm sure that there is such file, Here is my code:</p>
  
  <pre><code>text = File.read("m.txt").split('\n')
  text.each do |x|
      x.to_i
  
      File.open("m.txt", "w") do |file| 
        file.gsub(x, x *10)
      end
  end
  </code></pre>
  
  <p>The line that is generating this error:</p>
  
  <pre><code>text = File.read("m.txt").split('\n')
  </code></pre>
  
  <p>I have checked several examples, like this: <a href="https://stackoverflow.com/questions/7157207/how-can-i-read-a-file-with-ruby">How can I read a file with Ruby?</a></p>
  
  <p>And tried things like:</p>
  
  <pre><code>File.open("m.txt", "r+") do |infile|
      while (line = infile.gets)
          line.to_i.gsub(line, line *10)
      end
  end
  </code></pre>
  
  <p>But I'm still getting this error.</p>
  
  <p>What I'm trying to do is:  I have some numbers in text file like</p>
  
  <blockquote>
    <p>12.2<br>
     432.3<br>
     3.43<br>
     .342<br>
     ...</p>
  </blockquote>
  
  <p>And I want to multiply each one by 10. Note I'm sure about the file and that it exists.</p>