Skip to content
On this page

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.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

Attributes
Read

the path that failed to parse

Ruby version changes 1

  1. 3.2