Install your favorite IDE. Most IDEs support Ruby. Don’t have a favorite? Give Visual Studio Code a try.
Download Visual Studios Code if you haven’t already.
Once you launch your IDE, try to keep your projects organized. If you don’t have a project in mind, create a “sandbox” project to keep all of your miscellaneous scripts.
Moving on to Ruby. Ruby is a programming language. It’s also a software library that must be installed on your computer in order for you to run any programs written in Ruby. A Ruby script is simply a text file that is named with the “.rb” extension and the contents of the text file use the Ruby syntax. An example of a Ruby filename “myscript.rb”.
You can check if you have a version of Ruby installed by opening a terminal and running
ruby -v. If you get a version number you’re all set, if you get an error or warning then
you’ll need to install Ruby.
Let’s write some code in a file in your IDE and save it.
Once your file is saved, run the code from the IDE. Some IDEs will come preconfigured with the Ruby that’s already installed on your computer so you can simply press the “play” button.
IDEs can be configure to point to a specific version of Ruby so that the “play” button
will run the script for you using that version of Ruby. All of this is convenience - if
you run into any issues you can always get around this added layer of complexity by using
the built-in terminal and typing
Make sure you’re able to run Ruby code before moving on.