「Windows10」Ruby2.6.6-2の開発環境を構築する方法

■ Rubyのインストール方法
1.「rubyinstaller-devkit-2.6.6-2-x64.exe」をダブルクリックします。

2.「Ruby 2.6.6-2-x64 with MSYS2 License Agreement」画面が表示されます。

3.「I accept the License」を選択して、右下の「Next」ボタンをクリックします。

4.インストール先画面が表示されます。
ディフォルト場合、C:\Ruby26-x64
下記項目チェックを入れます
※「Add Ruby executeables to your PATH」
※「Associate .rb and .rbw files with this Ruby installation」
※「Use UTF-8 as default external encoding」

5.「Install」をクリックします。

6.「Select Components」画面が表示されます。
そのまま「Next」をクリックします。

7.インストールがはじまります。

8.「Completing the Ruby 2.6.6-2-x64 with MSYS2 Setup Wizard」が表示され、「Finish」をクリックします。

9.「Which components shall be installed? If unsure press ENTER[1,3]」が表示されます
※1- MSYS2 base installation」
※2 – MSYS2 system update (optional)
※3 – MSYS2 and MINGW development toolchain

10.半角の「1,2,3」を入力して、「Enter」キーを押下します。

11.インストール完了したら、「×」を閉じます。

■ Rubyのインストール後バージョン確認
1.「ここに入力して検索」の欄に「cmd」と入力します。

2.「コマンドプロンプト」をクリックします。

3.「ruby -v」と入力します。

4.実行結果
>ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32]

■ Rubyプログラムを実行
ファイル名:test.rb
ソースコード
puts “study skill in arkgame.com"

実行手順
>cd C:\study\skill\ruby
>ruby test.rb
study skill in arkgame.com

Ruby

Posted by arkgame