 <p><code>\</code> is an escape charecter in most languages, so the compiler expects an escaped char after it, in this case its also <code>\</code>, so you just need to use 2 of them</p> <pre><code>File.open("C:\\Users\\C*****\\Documents\\RubyProjects\\text.txt </code></pre>