Appendix B. Troubleshooting

When running your Ruby scripts or using IRB, you may run into some common errors. I’ve listed a few of them here, along with tips for fixing them!

Errors Running Ruby Scripts

There are two common errors that you might see when running Ruby scripts from the command line: Command Not Found and “no such file or directory.” Here are some suggestions for how to resolve them.

Command Not Found

If you’re running a Ruby script and you get some output that looks like this:

$: command not found

it probably means you accidentally typed a $ before your ruby command. I use the $ symbol to show you that you’re running a Ruby script from the command line with a filename (like ruby my_fancy_script.rb); you shouldn’t type the $ itself!

No ...

Get Ruby Wizardry now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.