Prerequisites for Installing Rails on Windows
- #Ruby
- #Rails
- #Tips
- #Know-how
- 2018/08/05
Setup
I tested on:
- Windows 10 (64-bit)
- Ruby 2.4
- Rails 5.2
Where it failed
Running
gem install rails
from the prompt threw an error complaining that msys2 was missing, and gem list --local confirmed the install never completed. Naturally rails -v did not work either.
Root cause and fix
- During the Ruby installer flow there is a screen that lets you install msys2. I skipped it, which caused the failure.
- You can apparently install msys2 separately, but I reinstalled Ruby instead.

After reinstalling Ruby, a prompt opens automatically. Do not press Enter immediately—follow these steps:
- Type
1and press Enter to install. - Type
2and press Enter to update. - Type
3and press Enter to install the MINGW toolchain.
I do not know every detail, but it seems required so Ruby can compile native extensions written in C.
Finally, rerun:
gem install rails
and the installation succeeds.
Share:
X (Twitter)