How to install Ruby on Rails on Windows 10
This article explain how to install Ruby on Rails on Windows 10.
This article explain how to install Ruby on Rails on Windows 10.
The following lists are the table of contents about this article.
- Target audience
- Environment
- Preconditions
- Install
- How to check installed packages
- Reference articles
Target audience
- Those who want to create Ruby on Rails environment on Windows 10.
Environment
- Windows 10 (1903)
- Chocolatey (0.10.15)
Preconditions
- Already installed Chocolatey
Install
Execute the following commands on Command Prompt or PowerShell as administrator.
REM Install Yarn
choco install yarn -y
REM Install Ruby
choco install ruby -y
REM Install msys2
choco install msys2 --params "/NoUpdate" -y
refreshenv
ridk install 2 3
REM Install SQLite
gem uninstall sqlite3 --all
ridk exec pacman -S mingw-w64-x86_64-sqlite3
gem install sqlite3 --platform ruby
REM Install bundle
gem install bundle
REM Install Ruby on Rails
gem install rails
If you want to specify version Ruby and Ruby on Rails, replace install Ruby and Ruby on Rails commands.
The following commands are an example.
When you install Ruby 2.4.2.2, use the following command instead of “choco install ruby -y”.
choco install ruby --version=2.4.2.2 -y
Also, when you install Ruby on Rails 5.2.2, use the following command instead of “gem install bundle rails”.
gem install rails -v 5.2.2
How to check installed packages
Execute the following commands on Command Prompt or Power Shell.
ruby -v
rails -v
You can check each version. The following information is an example.
C:\Users\testuser>ruby -v
ruby 2.6.4p104 (2019-08-28 revision 67798) [x64-mingw32]
C:\Users\testuser>rails -v
Rails 6.0.0