I have this piece of ruby code:

  def open(...)

and the first two lines have red boxes around them and when I hover over either one it says "syntax error, unexpected ..., expecting ')'"

I have lsp-mode, projectile, etc. Indeed, here is the complete list of minor modes in this buffer:

Enabled minor modes: Abbrev Async-Bytecomp-Package
Auto-Compile-On-Load Auto-Compile-On-Save Auto-Composition
Auto-Compression Auto-Encryption Blink-Cursor Company Eldoc
Electric-Indent File-Name-Shadow Flymake Font-Lock Global-Company
Global-Eldoc Global-Font-Lock Global-Rbenv Helm
Helm-Minibuffer-History Inf-Ruby Leaf-Key-Override-Global Line-Number
Lsp Lsp-Completion Lsp-Diagnostics Lsp-Headerline-Breadcrumb
Lsp-Managed Lsp-Modeline-Code-Actions Lsp-Modeline-Diagnostics
Lsp-Modeline-Workspace-Status Menu-Bar Mouse-Wheel Projectile
Projectile-Rails Recentf Rspec Rspec-Verifiable Rubocop Shell-Dirtrack
Show-Paren Tab-Bar Tooltip Transient-Mark

Someone is using the wrong version of Ruby but who?

1 Answer 1


What I did is put the point on top of the error line and then did M-: (face-at-point) which gave erm-syn-errline. I then went greping through the source and found that it was coming from enhanced ruby mode.

Looking in the source, I discovered that it parses the file using enh-ruby-program. So I temporarily customized the variable and that got rid of the errors.

I would be interested in more direct methods of solving this problem.

  • 2
    +1. What you did is quite direct. Alternatively, to find the file defining that face, you can use command describe-face. That tells you the file that face is defined in.
    – Drew
    Oct 30, 2022 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.