500 - internal server error

I follow the tutorial here: http://guides.rubyonrails.org/getting_started.html

Everything worked fine until I tried "8.1 Designing Partial Collections". I started getting this error message:

500 Internal Server Error

If you are the administrator of this website, please read this web page as the application log file and / or the website server log file to find out what went wrong.

In the development log file, I:

Started GET "/posts/3" for 127.0.0.1 at 2011-05-24 16:53:35 +0300
  Processing by PostsController#show as HTML
  Parameters: {"id"=>"3"}
  [1m[36mPost Load (0.2ms)[0m  [1mSELECT "posts".* FROM "posts" WHERE "posts"."id" = 3 LIMIT 1[0m
ERROR: compiling _app_views_posts_show_html_erb___599541849308356030_2168837280__3307996878912411319 RAISED /Users/username/Projects/blog/app/views/posts/show.html.erb:20: syntax error, unexpected tASSOC, expecting ')'
...         :collection => @post.comments );@output_buf...
...                                ^
Function body:           def _app_views_posts_show_html_erb___599541849308356030_2168837280__3307996878912411319(local_assigns)
            _old_virtual_path, @_virtual_path = @_virtual_path, "posts/show";_old_output_buffer = @output_buffer;;@output_buffer = ActionView::OutputBuffer.new;@output_buffer.safe_concat('<p class="notice">');@output_buffer.append= ( notice );@output_buffer.safe_concat('</p>
 
<p>
  <b>Name:</b>
  ');@output_buffer.append= ( @post.name );@output_buffer.safe_concat('
');@output_buffer.safe_concat('</p>

What's wrong?

Please, help.

EDIT: views / posts / show.html.erb:

<p class="notice"><%= notice %></p>
 
<p>
  <b>Name:</b>
  <%= @post.name %>
</p>
 
<p>
  <b>Title:</b>
  <%= @post.title %>
</p>
 
<p>
  <b>Content:</b>
  <%= @post.content %>
</p>
 
<h2>Comments</h2>
<%= render :partial => "comments/comment",
           :collection => @post.comments %>
 
<h2>Add a comment:</h2>
<%= render "comments/form" %>
 
<br />
 
<%= link_to 'Edit Post', edit_post_path(@post) %> |
<%= link_to 'Back to Posts', posts_path %> |

EDIT 2:

Heres views / comments / _comment.html.erb

<p>
  <b>Commenter:</b>
  <%= comment.commenter %>
</p>
 
<p>
  <b>Comment:</b>
  <%= comment.body %>
</p>

If I uninstall the following applications, follow these steps:

<%= render :partial => "comments/comment",
           :collection => @post.comments %>

However, if I change the contents of _comment.html.erb to blablabla, it still shows the same error.

+5
2

", tASSOC, ')'"

, - . , .

: " " views/posts/show.html.erb:20.

+4

, ')' views/posts/show.html.erb line no 20. .

0

All Articles