Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I execute a Ruby script using VSCode?

I'm using MacOS and I have installed VSCode, Ruby, rubocop, Ruby Solargraph, and their gem dependencies.

Having done this, how do I now execute a Ruby script without using the Terminal panel within VSCode?

like image 399
seeker Avatar asked Feb 28 '19 03:02

seeker


People also ask

Is VS Code good for Ruby?

This extension provides improved syntax highlighting, language configuration, and snippets to Ruby and ERB files within Visual Studio Code. It is meant to be used alongside the Ruby extension.

Can you execute code in Visual Studio?

Build and run your code in Visual Studio To build your project, choose Build Solution from the Build menu. The Output window shows the results of the build process. To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app.


1 Answers

You can use Coder Runner Extension.

Once adding the extension you press Command + Shift + P and select run by language then choose ruby

like image 75
Antarr Byrd Avatar answered Sep 20 '22 08:09

Antarr Byrd