In three years of Installfest, there is one thing that is guaranteed to strike fear in the hearts of our dedicated mentors: a Windows user having difficulty with their install. Well, it did up until now...
I have been lucky in Brisbane to have a wonderful mentor, Freibuis, who travels all the way from the Gold Coast to help out. Not only is he a great mentor, he is a bona fide out-of-the-closet Windows enthusiast with a background in ops! Almost too good to be true. :-)
With the introduction of Chocolatey, the whole "setting up a Rails environment on Windows" thing has become stupid-simple. Now we are all able to share the Freibuis magic courtesy of a chocolatey process he has developed for us to use at all our Installfests.
The first step is, of course, to install Chocolatey. You do that by running the following command in your terminal (be sure to open it as administrator)
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Once we have chocolatey installed, we can use it to install Ruby. Unfortunately Ruby 2.3 on Windows is currently broken with a lot of gems, so we use Ruby 2.2 which has better support.
choco install ruby -y -version 2.2.4
We also need to add Ruby to PATH so that our operating system knows where to find it. We do that with the following command:
Once we have Ruby, there are a few other useful tools we need to install:
cUrl is a command line tool for transferring data with URL syntax.
choco install curl -y.
GNU Wget is a software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols.
choco install wget -y.
Git is a powerful distributed Source Code Management tool.
choco install git -y.
This package is used to install nodejs.commandline.
choco install nodejs -y.
Sublime is a text editor especially designed for writing code. If you already have a preferred text editor you can skip this step.
choco install sublime -y.
Ruby Development Kit (DevKit) is a toolkit that makes it easy to build and use native C/C++ extensions for Ruby on Windows.
choco install ruby2.devkit -y.
To configure Ruby DevKit, we also need to run the following commands:
echo - c:/tools/Ruby22 > config.yml
ruby dk.rb install
So now we have everything set up and ready to go. All that remains is to install Rails! And it is as simple as running
gem install rails
in your terminal.
Ta da! How easy was that?
The whole process should take less than ten minutes and is as straightforward as installing on a Mac. However, if you do encounter any problems, come along to an Installfest near you and get some expert help.
The Axioms of Software Development - Part 6
How to Redirect a Rails Application to a new Domain Name
The Axioms of Software Development – Part 5
reinteractive is Australia’s largest dedicated Ruby on Rails development company. We don’t cut corners and we know what we are doing.
We are an organisation made up of amazing individuals and we take pride in our team. We are 100% remote work enabling us to choose the best talent no matter which part of the country they live in. reinteractive is dedicated to making it a great place for any developer to work.
Webinars are our online portal for tips, tricks and lessons learned in everything we do. Make the most of this free resource to help you become a better developer.
The Ruby on Rails Installfest includes a full setup of your development environment and step-by-step instructions on how to build your first app hosted on Heroku. Over 1,800 attendees to date and counting.
The Ruby on Rails Development Hub is a monthly event where you will get the chance to spend time with our team and others in the community to improve and hone your Ruby on Rails skills.