Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 362
dt1000 Avatar asked Dec 17 '11 00:12

dt1000


People also ask

How do I fix parse error syntax error unexpected?

The best way to solve it is to remove the recently added plugins by disabling them. The WordPress site is also likely to generate an error after a code edit. A mistake as simple as a missing comma is enough to disrupt the function of a website.

How to fix parse error in PHP?

To solve the missing parenthesis error in PHP, the code has to be checked from the beginning to search for it. One way to avoid errors is to use proper indentation in the code. Once all the parentheses in the code have been set correctly, parse error: syntax error, unexpected $end will be fixed.

What is syntax error unexpected?

Syntax Error – This error is caused by an error in the PHP structure when a character is missing or added that shouldn't be there. Unexpected – This means the code is missing a character and PHP reaches the end of the file without finding what it's looking for.

What is parse error in PHP?

Parse Error (Syntax) Parse errors are caused by misused or missing symbols in a syntax. The compiler catches the error and terminates the script. Parse errors are caused by: Unclosed brackets or quotes. Missing or extra semicolons or parentheses.


1 Answers

The extra space is the culprit. Use:

do_something(arg0, arg1)
like image 110
Paweł Obrok Avatar answered Oct 14 '22 17:10

Paweł Obrok