title: I got the error syntax error, unexpected $end, expecting keyword_end
body: <p>I'm first to ruby, so when i following the Guide(http://guides.rubyonrails.org/getting_started.html) I got the error like:</p>
  
  <blockquote>
    <p>Started GET "/questions" for 127.0.0.1 at 2012-06-07 17:22:36 +0900</p>
    
    <p>SyntaxError (/Users/sookcha/Desktop/Dev/CSap/app/models/question.rb:3: invalid multibyte char (US-ASCII)
    /Users/sookcha/Desktop/Dev/CSap/app/models/question.rb:3: syntax error, unexpected $end, expecting keyword_end
        validates :name,  :presence => true
       ^):
      app/controllers/questions_controller.rb:2:in `'</p>
    
    <p>Rendered /Users/sookcha/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.1ms)
      Rendered /Users/sookcha/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.1ms)
      Rendered /Users/sookcha/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (10.7ms)</p>
  </blockquote>
  
  <p>when I refresh the page, i got a different error below:</p>
  
  <pre><code>Started GET "/questions" for 127.0.0.1 at 2012-06-07 17:22:40 +0900
  
  NoMethodError (undefined method `key?' for nil:NilClass):
  </code></pre>
  
  <p>My code is</p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
  attr_accessible :content, :name, :title
  validates :name,  :presence =&gt; true
  validates :title, :presence =&gt; true,
                    :length =&gt; { :minimum =&gt; 5 }
  
  end
  </code></pre>
  
  <p>What's wrong with my code?
  <br /></p>
  
  <p>EDIT</p>
  
  <p>When I insert
  <code># encoding: utf-8,</code> in my code,
  I got a different error like:
  <code>
  /Users/sookcha/Desktop/Dev/CSap/app/models/question.rb:5: syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' validates :name, :presence =&gt; true ^ /Users/sookcha/Desktop/Dev/CSap/app/models/question.rb:7: syntax error, unexpected tASSOC, expecting keyword_end :length =&gt; { :minimum =&gt; 5 } ^):</code>
  <br />
  What's wrong?</p>