Look carefully. They are not the single quotes that you get from your keyboard, but 'typographically correct' curved single quotes. That's the problem that InDesign reports.
Usually this happens when you copy a script out of a document or web page that applied 'text enhancements', and it can easily be fixed by replacing them in your local code editor.
However! Since you also say "I have tried double quotes", then I'm going to suggest that the problem is at your side, and it's your code editor that keeps curling your quotes. Better check that first.
Thanks, Jongware! I am not used to using a mac and the TextEditor was curling the quote (font was so small, I didn't notice it). Works fine now.
TextEditor is not the best possible code editor. You can also look at TextWrangler and Sublime Text – I use both, off and on. They each have their idiosyncrasies (= both unexpected included and not-included features) but either should do much better than that ol' jack of all trades, master of none TextEditor.