Environment Setup: Ruby on Rails: Platform : Windows

Environment Setup: Ruby on Rails: Platform : Windows


STEP 1:

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

Image description

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

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

This will open the window as shown below

Image description

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

Image description

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

(Search cmd in Start menu/Search bar)

Image description

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

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

Image description

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 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

© 2024 Harsh Pal