Environment Setup: Ruby on Rails: Platform : Windows
Tags: ruby, rails, windows, setup
Published: 2022-02-17 10:27:10

Environment setup of Ruby on Rails is a headache for newbie developers so let's how we can easily establish a link between the software and new developer. Just sit back and relax and follow :P ! Without wasting more time let's just get started

**STEP 1:**

Install Ruby installer from https://rubyinstaller.org/downloads/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jl4kmnl3ctc55ojts7fq.png)

Since I have x64 Windows machine hence I will be downloading that.

You can check yours using Windows 
**Settings > System > Scroll Down** ( About) Your will see your System type as shown below : 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shqgl87j01w8xplr2wgw.png)

What the Devkit version ?

- RubyInstaller uses the MSYS2 toolchain as its development kit. It is bundled into the Ruby+Devkit installer version as a selectable component, so that no additional downloads/installs are required. It’s possible to share one Devkit among multiple versions of Ruby. MSYS2 is required in order to build native C/C++ extensions for Ruby and is necessary for Ruby on Rails


##### source: https://rubyinstaller.org/

**STEP 2:**

Open Installer install it as the normal application no need to interfere the default configuration just next next LOL!


**STEP 3:**

Setting up Environmental variable:

Search Environmental Variable in Start menu / Search Bar of Windows

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmwocrw3ibump1356gan.png)
 

This will open the window as shown below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yzuo17vwaw5wipux4iw.png)


Click on Environment Variable (at right down corner) as shown in image below: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upp5kn94xs2vvby5of7o.png)

Now to check it is successfully installed open command line (cmd)

(Search cmd in Start menu/Search bar)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dg8chn3k1tbcemwi5wj.png)
    
Check this line it should contain the path of your ruby version mine is ( C:\Ruby30-x64\bin) if it is not there in your add it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/no396memrjgh4viimsr5.png)

Type command `ruby --version` you will get the version name if installed successfully Kudos! 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su26eds8pbt1gf540wdk.png)

To setup binaries follow the steps here https://www.msys2.org/ 

download msys2 and as per instruction given in msys2 website do it. Now that you have done that all the binaries are installed we are very close to our missing Here after step 7 do type the following command in same terminal) 

`pacman -S mingw-w64-x86_64-yarn
pacman -S mingw-w64-x86_64-nodejs`


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38gxtmm8gprnfazh8tt7.png)
Nodejs and yarn are required for Webpacker and msys2 since both 

Now we need to Install Rails :

Open cmd type below command 

`gem install rails`

to check if successfully installed type `rails --version`