title: NameError: undefined local variable or method in irb
body: <p>I am using ruby 1.9.2 with irb and I keep getting the following error message:</p>
  
  <pre><code>NameError: undefined local variable or method `ex1' for main:Object
  from (irb):4
  from /Users/flexmaster411/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in `&lt;main&gt;' 
  </code></pre>
  
  <p>I have also tried to drag and drop into irb then I get another argument error the code.</p>
  
  <pre><code>Rodas-MacBook-Air:~ flexmaster411$ pwd /Users/flexmaster411
  Rodas-MacBook-Air:~ flexmaster411$ cd Desktop
  Rodas-MacBook-Air:Desktop flexmaster411$ cd my
  Rodas-MacBook-Air:my flexmaster411$ ls
  ex1.rb ex2.rb   test.html   test.rb  wacky.rb
  Rodas-MacBook-Air:my flexmaster411$ irb
  1.9.2-p320 :001 &gt; ruby ex1.rb
  NameError: undefined local variable or method ex1' for main:Object from (irb):1 from /Users/flexmaster411/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in &lt;main&gt;' 
  </code></pre>