title: Ruby undefined method `+' for nil:NilClass
body: <p>I'm a total beginner in ruby but I can't get out of this issue 
  I get these when I run the code, it all works well until the end:</p>
  
  <p>INPUT TEXT:  It all works well until</p>
  
  <p>INPUT SUBTEXT:  ll</p>
  
  <p>TEXT: It all works well until SUBTEXT: ll</p>
  
  <p>OUTPUT:
  4
  15</p>
  
  <p>undefined method <code>+' for nil:NilClass
  (repl):18:in</code>initialize'</p>
  
  <pre><code>   puts "\nINPUT TEXT:"
      @text =  gets.chomp
  
  puts "\nINPUT SUBTEXT:" 
      @subtext = gets.chomp
  
      puts "\nTEXT: " + @text
      puts "SUBTEXT: " + @subtext
      puts "\n"
      i = @text.index (@subtext)
  
      puts "OUTPUT:"
  
      while i != -1
              puts  i.to_s + ' '
              i = @text.index @subtext, i+1
      end
  </code></pre>