Download & Install Ruby on Windows
You can now install both Ruby 2.6 and DevKit together from rubyinstaller website. But if you only need ruby to be installed on your windows system, just download any ruby 2.x version from Ruby without DevKit download section.
https://rubyinstaller.org/downloads/

Download & Install DevKit on Windows
If you wish to install Ruby on Rails on Windows then you’ll require DevKit, which helps C-extensions compile immediately. Previously DevKit was downloaded and installed separately on Windows systems. Now, both ruby and DevKit can be installed together with just one click from rubyinstaller website.

To install Ruby on Rails, you need to install ruby with DevKit. Once your ruby is installed, check the ruby version with following command.
ruby -version
Install NodeJS and Yarn for Ruby on Rails

You’ll require Nodejs and Yarn to be installed before your start installing Rails 6.
Download & Install NodeJS
To install NodeJS, simply visit nodejs.org and download the latest or the stable version of Node and install it. With Node installation, you get nodejs, npm, and npx but yarn needs to be installed once you have nodejs installed on your system.
Install Yarn for Rails
npm i -g yarn
Let’s install Ruby on Rails 6
To install Ruby on Rails 6 without document. I do not prefer installing docs just because it takes time and space on the system.
gem install rails --no-document
It takes time. I know. After Rails is installed. Just create a demo app to test if Rails Development environment is set up properly.
rails new demoapp
cd demoapp
rails server
There is possibility that you’ll get errors, to fix errors scroll down. I have listed few common errors with solutions.
Rails Posts you might like
- Rails 6 Tutorial – Create your first app
- Install Rails without Documentation
- How to Install Ruby on Rails 5.1.4 on Ubuntu 16.04 / 17.04
Watch me install Ruby on Rails on Windows
Rails sqlite3 gem error – Windows 7/8/10

Replace gem sqlite3 with the following code and run bundle install
gem 'sqlite3', '~> 1.4'
replace with
gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
or..
gem ‘sqlite3’, ‘~> 1.3’
or ..
gem 'sqlite3'
One of the above must work with your setup, then
bundle install && rails server
RAILS_ENV=development environment is not defined
Simply run the following command, make sure you have already installed nodejs and yarn
rails webpacker:install
Now go ahead and run bundle install and rails server
bundle install
rails server
ActiveRecord::ConnectionNotEstablished
No connection pool with ‘primary’ found.
Replace the following line in Gemfile
gem 'sqlite3', '~> 1.4'
with
gem "sqlite3"
Puma caught this error: Error loading the ‘sqlite3’ Active Record adapter

In Gemfile replace sqlite3 gem with following command and bundle install
gem 'sqlite3'
Now,
bundle install && rails server
Now run bundle install and rails server

Hi
When I complete everything in last the command prompt says node.js is not installed in windows ( but its installed) also saying that Node.js is not recognized as an internal or external command Please help me
Please add installation to nodejs and yarn
added… Thanks