This is just a documentation of how I did a fresh install of Ruby on Rails on a Windows 10 (64-bit) system. If there is a faster way of doing this, *oh God*, please tell me.

Issue on installing versions of Ruby


In an Unix based system, I usually use RVM for version management. But I had an issue using this on Windows as it needs commands that are linux based. Installing cygwin didn't gave justice here as I end up adding and adding a lot of libraries too many times. In the end, I gave up on RVM and look for an alternative which is Pik. (see this article)

Again, I know that the Pik author already stopped maintaining it, but then I find the installation easier than RVM.

A Documentation of My Ruby on Rails Installation in Windows 10

Gems needed

A fresh install requires to install at least gem for bundle: gem insall bundle. This way, you can run a bundle installation that will set-up all other gem dependency of your app.

DevKit Issue

Another gem that I have issued with is the json gem. To solve, download RubyInstaller DevKit and make sure that this is added properly on your PATH.

Also make sure that you are using the correct version of DevKit as this is dependent also with the ruby version. You may need to run the following to add it on your PATH:
> ruby dk.rb init
> ruby dk.rb init

Upon setting this up, re-installing the json gem should be successful now.

Running an existing app

My app is running on Ruby 1.9.3 with a gem 1.8.29, as of this writing the latest is Ruby 2.2.3 with a gem around 2.X.

Running bundler install returned an error about certificate when it tries to access 'https://rubygems.org' in the Gemfile. Reading over stackoverflow states that the a way to solve this is to update your gems. Updating this unfortunately causes an error for me as it upgrades to version 2.2.3 and the gems that I'll be using are still on the old version. Specifically, installing the eventmachine gem.

Reverting to 1.8.29 gem version also gave me an error. So, to solve this, I re-install my Ruby 1.9.3 version. Upon reverting back to the old gem version, I replace the https to http in the gem file and re-run the bundle install.


So far those are the items I have encountered, there might be a simple way to install a multiple vesion ruby on rails on a Windows system but for now, this should do.

No comments :

Post a Comment