Creating Ruby Programs
The most common way to write Ruby programs is to put the Ruby code in one or more text files. You’ll use a text editor or an Integrated Development Environment (IDE) to create and maintain these files—many popular editors, including Visual Studio Code, vim, Sublime Text, and RubyMine, feature Ruby support. You’ll then run the files either from within the editor or from the command line. Both techniques are useful. You might run single-file programs from within the editor and more complex programs from the command line.
Let’s create a short Ruby program and run it. Open a terminal window and create an empty directory somewhere, perhaps you could call it pickaxe.
Then, using your editor of choice, create the file myprog.rb ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access