Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

` (backtick) is unexpected token

Tags:

bash

ruby

I'm doing some command line executions I learned in this blog post such as system or IO.popen on the file, and am getting errors.

Why is the backtick appearing, what does it mean, and how do I continue? Please explain.

 system('./err.rb')
-bash: syntax error near unexpected token `'./err.rb''

Similarily, when I run IO.popen:

output = IO.popen('./err.rb')
-bash: syntax error near unexpected token `('
like image 627
BrainLikeADullPencil Avatar asked Nov 22 '25 07:11

BrainLikeADullPencil


1 Answers

That's not ruby you're typing things into, it's your shell bash. Assuming you've got ruby installed properly, type irb to get a ruby prompt and you should be able to proceed from there.

like image 75
hammar Avatar answered Nov 25 '25 00:11

hammar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!