syntax error, unexpected ',', expecting ')'

dt1000 picture dt1000 · Dec 17, 2011 · Viewed 36.8k times · Source

I just installed Ruby 1.9.2 after having used 1.8.7, as there is a feature I need. I had called many of my methods like this:

do_something (arg0, arg1)

With 1.9.2, i get the following error, syntax error, unexpected ',', expecting ')' and the fix seems to be:

do_something arg0, arg1

But this could take me hours to fix all the cases. Is there a way around this? Why is it an error in the first place? thanks

Answer

Paweł Obrok picture Paweł Obrok · Dec 17, 2011

The extra space is the culprit. Use:

do_something(arg0, arg1)