Note that there are some explanatory texts on larger screens.

plurals
  1. PO500 Internal Server Error
    text
    copied!<p>I'm following the tutorial here: <a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">http://guides.rubyonrails.org/getting_started.html</a></p> <p>Everything was working fine until I tried "8.1 Rendering Partial Collections" I started getting this error message:</p> <blockquote> <p>500 Internal Server Error</p> <p>If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.</p> </blockquote> <p>In the development log file I have:</p> <pre><code>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"=&gt;"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 =&gt; @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('&lt;p class="notice"&gt;');@output_buffer.append= ( notice );@output_buffer.safe_concat('&lt;/p&gt;   &lt;p&gt;   &lt;b&gt;Name:&lt;/b&gt;   ');@output_buffer.append= ( @post.name );@output_buffer.safe_concat(' ');@output_buffer.safe_concat('&lt;/p&gt; </code></pre> <p>What's wrong?</p> <p>Please help.</p> <p>EDIT: views/posts/show.html.erb:</p> <pre><code>&lt;p class="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;   &lt;p&gt;   &lt;b&gt;Name:&lt;/b&gt;   &lt;%= @post.name %&gt; &lt;/p&gt;   &lt;p&gt;   &lt;b&gt;Title:&lt;/b&gt;   &lt;%= @post.title %&gt; &lt;/p&gt;   &lt;p&gt;   &lt;b&gt;Content:&lt;/b&gt;   &lt;%= @post.content %&gt; &lt;/p&gt;   &lt;h2&gt;Comments&lt;/h2&gt; &lt;%= render :partial =&gt; "comments/comment",            :collection =&gt; @post.comments %&gt;   &lt;h2&gt;Add a comment:&lt;/h2&gt; &lt;%= render "comments/form" %&gt;   &lt;br /&gt;   &lt;%= link_to 'Edit Post', edit_post_path(@post) %&gt; | &lt;%= link_to 'Back to Posts', posts_path %&gt; | </code></pre> <p>EDIT 2:</p> <p>Here’s views/comments/_comment.html.erb</p> <pre><code>&lt;p&gt;   &lt;b&gt;Commenter:&lt;/b&gt;   &lt;%= comment.commenter %&gt; &lt;/p&gt;   &lt;p&gt;   &lt;b&gt;Comment:&lt;/b&gt;   &lt;%= comment.body %&gt; &lt;/p&gt; </code></pre> <p>If I remove the following the app runs:</p> <pre><code>&lt;%= render :partial =&gt; "comments/comment",            :collection =&gt; @post.comments %&gt; </code></pre> <p>However, if I change the content of _comment.html.erb to blablabla it still show the same error.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload