Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.1

SyntaxError

< ScriptError 1 class methods

Raised when encountering Ruby code with an invalid syntax.

Example
eval("1+1=2")

raises the exception:

SyntaxError: (eval):1: syntax error, unexpected '=', expecting $end

Class methods 1