Procedure to create Ruby execution environment locally

Procedure to create Ruby execution environment locally

How to allow .rb files to be executed locally.

Ruby download

From the official Ruby page Select the recommended version (=>) and install

https://rubyinstaller.org/downloads/

image.png

Ruby + Devkit 2.6.6-1 (x64) is 130MB.

Installation execution

** ▼ Check I accept the License ** image.png

** ▼ Click Install ** image.png

** ▼ Click Next ** image.png

** ▼ Click Finish ** image.png

** ▼ Enter 1 and 3 and Enter ** image.png

▼Enter image.png

Installation is complete.

Confirmation of installation

ruby -v If it is installed, the version will be displayed.

image.png

(↑ Use gitbush)

Create and run .rb files

command


#Go to desktop
$ cd ~/desktop

#.rb file creation
$ touch index.rb

#launch vim editor
$ vi index.rb

The vim editor will be launched, so enter the following

index.rb


puts "Hello"
puts 1+2*3

"I": Insert mode "Esc": Exit from insert mode ": Wq": Save and close

How to use the vim editor


command


#Execute ruby (OK if the contents are output)
$ ruby index.rb
Hello
7

#File deletion
$ rm index.rb

that's all. It took longer than I expected to download, but it's relatively fast after that.

Recommended Posts

Procedure to create Ruby execution environment locally
Sample to create PDF from Excel with Ruby
Introduction to Ruby 2
Error installing ruby execution environment on EC2 instance
Rails6.0 ~ How to create an eco-friendly development environment
Build a development environment to create Ruby on Jets + React apps with Docker
Docker command to create Rails project with a single blow in environment without Ruby
[Introduction] Try to create a Ruby on Rails application
How to create a Java environment in just 3 seconds
(Ruby on Rails6) How to create models and tables
From Java to Ruby !!
How to create docker-compose
I tried to create a java8 development environment with Chocolatey
From 0 to Ruby on Rails environment construction [macOS] (From Homebrew installation to Rails installation)
[Procedure 1 for beginners] Ruby on Rails: Construction of development environment
I tried to create React.js × TypeScript × Material-UI on docker environment
I want to create a Parquet file even in Ruby
Introduction to Parallel Processing + New Parallel Execution Unit in Ruby Ractor
I tried to create a padrino development environment with Docker