I’ve started a new Ruby on Rails project last week and just finished setting up Codium, which is my go-to code editor, for Ruby programming. It has always impressed me how easy it is to run Python scripts in Visual Studio and Codium. Just press the little play icon and the code instantly runs in the terminal.
Ruby code can be just as easy to execute
Installing Code Runner gives me the same functionality with Ruby as I get executing Python code. But installing Code Runner alone is not enough. The above image shows the Code Runner extension followed by some descriptive text. There is also a small cog-wheel which opens the settings and this is where things get interesting.
Code Runner extension settings
To get started, go to: File > Preferences > Extensions > Code Runner
Then click the small cog wheel to open the extension settings as shown in the image above.
To access the values which need changing, copy/paste this into the search field: @ext:formulahendry.code-runner
The first thing I turned off was the telemetry setting.
Code-runner: Enable App Insights
Uncheck the check mark unless you want to submit app usage data.
Next, find the Code-runner: Run In Terminal setting and place a check mark next to whether to run code in integrated Terminal.
Lastly, I also placed a check mark next to whether to save the current file before running.
Code-runner:Save File Before Run
With just three clicks, I managed to mimic the same functionality I get when working with Python. This is so simple that I had to write about it. Ruby isn’t exactly a growing language these days but for certain projects, Ruby and Ruby on Rails has no match.
Don’t take my word for it
Fireship is a YouTube Channel with over 1.5 Million subscribers. On April 6, 2022, they published a video with the title: I built 10 web apps… with 10 different languages
The video concludes stating that Ruby on Rails is still king. I recommend that you watch that video which has been viewed about 650000 times so far.
Hopefully, portions of this article were helpful in setting up Codium for Ruby programming. I have always loved how easy it is to execute Python scripts. Now I have the same functionality for Ruby and soon for PHP programming as well. No doubt, I will write more about Ruby and feature a handful of content creators who authored the best video tutorials. Stay tuned for updates.