title: Is Rails 3.2.8 compatible with Ruby 1.9.3?
body: <p>I've been trying to follow the <a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">official rails guide</a> and have run into an issue. There seems to be a syntax error message on code that was scaffolded in a new project using: </p>
  
  <p><code>rails generate scaffold Post name:string title:string content:text</code>.</p>
  
  <p>Simple enough, right? I'm just going through the first page of the official rubyonrails.org "Make a blog" tutorial. But when I go to <code>http://localhost:3000/posts</code> I get this issue.</p>
  
  <h1>The SyntaxError Message:</h1>
  
  <pre><code>/projects/blog/app/controllers/posts_controller.rb:9: syntax error, unexpected ':', expecting '}'
  format.json { render json: @posts }
                            ^
  </code></pre>
  
  <p>On <a href="http://guides.rubyonrails.org/getting_started.html#working-with-posts-in-the-browser" rel="nofollow">step 6.3</a> I'm supposed to be seeing a simple "Listing posts" page, with presumably no blog entries.</p>
  
  <h1>My posts_controller.rb file:</h1>
  
  <pre><code>class PostsController &lt; ApplicationController
    # GET /posts
    # GET /posts.json
    def index
      @posts = Post.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @posts }
      end
    end
  ...(continued. This was all generated via a scaffold.)
  </code></pre>
  
  <h1>My setup:</h1>
  
  <p>The <a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">guide</a> says:</p>
  
  <blockquote>
    <p>This Guide is based on Rails 3.2. Some of the code shown here will not work in earlier versions of Rails.</p>
  </blockquote>
  
  <p>My <code>rails -v</code> says:</p>
  
  <p><code>Rails 3.2.8</code></p>
  
  <p><a href="http://rubyonrails.org/download" rel="nofollow">rubyonrails.org</a> says:</p>
  
  <blockquote>
    <p>We recommend Ruby 1.9.3 for use with Rails. Rails 3.2 is the last one that supports Ruby 1.8. Ruby 1.8.6 and earlier are not supported, neither is version 1.9.1.</p>
  </blockquote>
  
  <p>My <code>ruby -v</code> says:</p>
  
  <p><code>ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]</code></p>
  
  <p>I always get that SyntaxError message, even after trying different versions of Ruby (using rbenv). Here are the versions I've tried:</p>
  
  <p><code>1.9.2-p290</code></p>
  
  <p><code>1.9.2-p320</code></p>
  
  <p><code>1.9.3-p194 (latest)</code></p>
  
  <h1>Workaround:</h1>
  
  <p>Changing <code>format.json { render json: @post }</code> to <code>format.json { render :json => @post }</code> fixes the issue.</p>
  
  <h1>My Question:</h1>
  
  <p>Why, with the latest version of Ruby and the latest version of Rails, would I get a SyntaxError when the versions are supposed to be compatible? At this point in the first page of the official tutorial, I haven't even written any ruby. These lines in my <code>posts_controller.rb</code> file were <em>generated</em> by the latest stable version of Rails and the syntax is outdated? Rails hasn't been updated to use Ruby syntax going back to version 1.9.2?</p>