# Syntaxerror while starting server

**URL:** <https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912>\
**Category:** Rails\
**Created:** [March 4, 2008, 12:33pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912 "2008-03-04T12:33:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 12:33pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/1 "2008-03-04T12:33:09Z")

</div>

Hi there.  
I get an syntax error on this line (135) when i start my server. I have  
out-commented the line for now, but would really appreciate any help.

[code]  
error\_messages = objects.map {|object| object.errors.full\_messages.map  
{|msg|

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 12:41pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/2 "2008-03-04T12:41:57Z")

</div>

Emil K. wrote:

> error\_messages = objects.map {|object| object.errors.full\_messages.map  
> {|msg|

Uh…

error\_messages = objects.map{|object|  
object.errors.full\_messages.map{|msg|

?

I think, if the posted code is _exactly_ what’s in your file, that the  
Ruby  
parser cannot bond the second map to the second {. It compiles the  
equivalent of  
map;{ - which is a syntax error.

–  
Phlip  
[O'Reilly Media - Technology and Business Training](http://www.oreillynet.com/ruby/blog/2008/03/beast_acts_as_sphinx.html)

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/3 "2008-03-04T14:27:54Z")

</div>

On 4 Mar 2008, at 11:50, Emil K. wrote:

> > –  
> > Phlip  
> > [O'Reilly Media - Technology and Business Training](http://www.oreillynet.com/ruby/blog/2008/03/beast_acts_as_sphinx.html)
> 
> The code is _exactly_ the code in my file. It suddently began failing,  
> for no apparent reason. I did not change this file, i changes  
> something  
> in the collection\_select helper, then this error occured while i tried  
> to create a new model from the terminal.

That code just can’t have ever worked. It looks like it’s missing a  
second line.

Fred

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/4 "2008-03-04T12:50:10Z")

</div>

Phlip wrote:

> I think, if the posted code is _exactly_ what’s in your file, that the  
> Ruby  
> parser cannot bond the second map to the second {. It compiles the  
> equivalent of  
> map;{ - which is a syntax error.
> 
> –  
> Phlip  
> [O'Reilly Media - Technology and Business Training](http://www.oreillynet.com/ruby/blog/2008/03/beast_acts_as_sphinx.html)

The code is _exactly_ the code in my file. It suddently began failing,  
for no apparent reason. I did not change this file, i changes something  
in the collection\_select helper, then this error occured while i tried  
to create a new model from the terminal.

I have out-commented it, and now it compiles, but I guess the line _is_  
important somewhere, so im reluctant to just keep it uncommented.

Can you post your line? So i can copy-paste yours? Perhaps mine have  
some strange encoded whitespace?

- Emil

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 6:17pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/5 "2008-03-04T18:17:41Z")

</div>

On 4 Mar 2008, at 16:31, Emil K. wrote:

> Frederick C. wrote:
> 
> > That code just can’t have ever worked. It looks like it’s missing a  
> > second line.
> > 
> > Fred
> 
> Do you mind posting that line(s) from your file? So i can use those.

What file? I’ve been assuming this is something in your app.

Fred

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 5, 2008, 12:20am UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/6 "2008-03-05T00:20:02Z")

</div>

Frederick C. wrote:

> What file? I’ve been assuming this is something in your app.
> 
> Fred

No, it happens in the  
/usr/local/lib/ruby/gems/1.8/gems/actionpack1.13.5/lib/action\_view/helpers/active\_record\_helper.rb:135

- Emil

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 4, 2008, 5:31pm UTC](https://www.ruby-forum.com/t/syntaxerror-while-starting-server/130912/7 "2008-03-04T17:31:01Z")

</div>

Frederick C. wrote:

> That code just can’t have ever worked. It looks like it’s missing a  
> second line.
> 
> Fred

Do you mind posting that line(s) from your file? So i can use those.

- Emil
