Syntax Error, Unexpected ',', Expecting ')'

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

2

1 Answer

The extra space is the culprit. Use:

do_something(arg0, arg1)
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest