title: How do I open ruby file in irb?
body: <p>I'm currently using AWS cloud 9. I want to run my code but when I use the ruby command to open up my ruby file in irb it sometimes works or it gives me the error message below.</p>
  <pre class="lang-none prettyprint-override"><code>2.6.3 :001 &gt; ruby directory.rb
  Traceback (most recent call last):
          4: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/bin/irb:23:in `&lt;main&gt;'
          3: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/bin/irb:23:in `load'
          2: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `&lt;top (required)&gt;'
          1: from (irb):1
  NameError (undefined local variable or method `directory' for main:Object)
  </code></pre>