Hi guys,
I'm trying to create a simple alfred workflow (Keyword -> Run Script -> Post Notification) using ruby. If I run this scripts in the terminal, it runs just fine, but when I try to run them on Alfred, I get some errors:
ruby start.rb {query}
[ERROR: alfred.workflow.action.script] Code 1: -e:1:in `<main>': undefined local variable or method `start' for main:Object (NameError)
I assumed that ruby wasn't in Alfred path so I tried
/usr/bin/ruby start.rb {query}
and got this error:
[ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b
-e:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
/usr/bin/ruby start.rb asda
If I use double quotes on the script name i get this errors:
ruby "start.rb" {query}
[ERROR: alfred.workflow.action.script] Code 1: -e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
and
/usr/bin/ruby "start.rb" {query}
[ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b
-e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
/usr/bin/ruby "start.rb" asda
^
-e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
Can someone enlighten me why this is happening?
Thanks!