Install Rails onto new Windows System#

This document serves as summary of what steps were carried out to install the current version of rails onto a Windows Server systems.

Download and install for windows#


Download the latest 64 bit version (Ruby+Devkit).

Install Options
and the 2nd screen prompts for toolset install. On this installation (development machine), we'll go ahead and take the option. However, I don't expect I'll do that on production.

Ruby Developer options.



Install rails#

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

> ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]

> gem install rails

This is why people hate rails for windows, the battle with version sync. We've fallen over on this.

Successfully installed i18n-1.8.2
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.7
Successfully installed zeitwerk-2.3.0
Successfully installed activesupport-
Successfully installed rack-2.2.2
Successfully installed rack-test-1.1.0
Successfully installed mini_portile2-2.4.0
ERROR:  Error installing rails:
        The last version of nokogiri (>= 1.6) to support your Ruby & RubyGems was 1.10.9. Try installing it with `gem install nokogiri -v 1.10.9` and then running the current command again
        nokogiri requires Ruby version >= 2.3, < The current ruby version is


Trying a local build

> gem install nokogiri --platform=ruby
Fetching nokogiri-1.10.9.gem
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.9
Parsing documentation for nokogiri-1.10.9
Installing ri documentation for nokogiri-1.10.9
Done installing documentation for nokogiri after 4 seconds
1 gem installed

> gem rails install
> rails -v

Install notes#

This failed as an initial installation option due to old version of ruby#


Download latest 64bit version. At 27/05/20 there were two versions (ruby 2.2, and ruby 2.3).I've selected the 2.3 for the fact it's the latest and our system is a basic CRUD app, so I expect nothing to fail in terms of version compatibility.

This appears to install Rails 5.1, so manually upgrade to Rails 6.x.
Will the gemfile pull in a specific rails version for this project?

We'll install to "c:\" because this system has the production database on "d:", so until there's a succinct IT policy, let's just take the defaults.

Note that git is de-selected because it already exists on this system.

After installation here, the versions are:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

> rails -v
Rails 5.1.3

> ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

Let's update rails to 2.6.x

gem update rails
Updating installed gems
Updating rails
Fetching: zeitwerk-2.3.0.gem (100%)
ERROR:  Error installing rails:
        zeitwerk requires Ruby version >= 2.4.4.
Gems updated: zeitwerk
Gems already up-to-date: rails

That's failed, so how do we update Ruby versions?