title: private method `chomp' called for nil:NilClass (NoMethodError)
body: <p>I am attempting to learn Ruby by converting a Java program to Ruby, but I've been coming up with an error surrounding this block of code:</p>
  
  <pre><code>  def create
      @user_input = String.new()
  #   @word_arr = Array.new
  
    print "Enter the text to be converted to pig latin, EOF to quit: "
      while gets do
        STDOUT.flush
        @user_input = gets.chomp
        @word_arr = @user_input.string.split(' ')
        @word_arr.each { |x| puts x.engToLatin() + ' '}
        print "EOF to Quit"
        @user_input = ""
  
      end
  
    end
  </code></pre>
  
  <p>I've been getting this error:</p>
  
  <pre><code>EnglishToPigLatin.rb:14:in `create': private method `chomp' called for nil:NilClass (NoMethodError)
      from EnglishToPigLatin.rb:60
  </code></pre>
  
  <p>This is the area around line 60:</p>
  
  <pre><code>#if __FILE__ == $0
  
    mg = EnglishToPigLatin.new
    mg.create
  
  #end
  </code></pre>
  
  <p>Essentially what I am trying to do is while there is still input, get that input, split it up into individual words, and run each word through a Pig Latin conversion method.</p>