title: The "end" statement in Ruby
body: <p>I have a <code>if</code>, <code>else</code>, and <code>else if</code> statement, and I'm using the official documentation for Ruby, but I can't figure out where to put my <code>end</code> statements.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>class Menu
    def principal_menu
      user_input = gets
      #On supprime le \n du retour à la ligne
      user_input = user_input.chomp
      if user_input == "3"
        exit
      else if user_input == "1"
        if File.exists?("accounts.txt")
      else 
        File::new("accounts.txt","w+")
      end
  
      else if user_input == "2"
        new_account = account.new
      end
    end
  end
  </code></pre>
  
  <p>The error is: <code>AccountManager.rb:63: syntax error, unexpected end-of-input, expecting keyword_end</code></p>
  
  <p>Note: Line 63 is the very end of the file.</p>
  
  <p>Could some one help a newbie in Ruby :D</p>
  
  <p>Thanks!</p>