Build a Ruby development environment on Windows

1. Download the RubyInstaller

Go to RubyInstaller.org to download it

2. Install Ruby

Double-click the Ruby installation package RubyInstaller to go straight to the next step. When the installation is complete, run the command: ruby-v and display the version number to show that the installation was successful.

3. Install the Devkit

  • Download the corresponding version of Devkit from rubyinstaller.org;

  • Unzip the downloaded DevKit and select the unzip path. This path is the installation path of DevKit.

  • Go to the Devkit directory and run the command :ruby dk.rb init in the command window. This will produce a configuration file config.yml.

  • Open theconfig.ymlThe file will berubyOf the installation path plus, the format is:-+ Space + Ruby installation directoryThat is as follows:- C: \ Program \ Ruby \ 2.2.4

  • Then execute the installation command Ruby dk.rb install.

4. Install RubyGems

  • Download the RubyGems Package: rubygems.org github.com

  • Unzip the downloaded zip package;

  • Enter the unpacked directory, execute the installation command ruby setup.rb, and wait for the installation to complete;

  • When the installation is complete, execute the command gem -v, and if you print the book number, the installation is successful.

5. Call it a day

At this point, the Ruby development environment is basically complete and you can write Hello World happily.