January 2024
Intermediate to advanced
718 pages
20h 15m
English
It’s a little clunky to have to call ruby my_code.rb when you want to run your code; it’d be easier if you could use my_code.rb. This is more of an operating system tip than a Ruby tip, but on Unix systems, this is doable with just a couple of steps.
First, you need to make the file executable by changing the mode of the file. To oversimplify slightly, the mode of the file is metadata that determines if the current user can read from, write to, or execute a given file. Typically, on a Unix-based system, the command to make a file executable is chmod +x <FILENAME>. The chmod command is Unix-speak for “change the mode of the file,” +x means “make it executable,” and FILENAME is the filename. For more on ...
Read now
Unlock full access