Windows installation process - Sonicandr/fullstack-course1-module1 GitHub Wiki

NOTE: These instructions are related to the RailsInstaller that comes with Ruby 2.1 and Rails 4.2. If you are using the most recent version (with Ruby 2.2), there are different steps you will have to take. Please refer to the Wiki homepage for questions related to the installation.


These are the tools that you will need for course one, which are Ruby, Rails, Git, PhantomJS and Sublime Text.

The first three - Ruby, Rails and Git - can be installed as one single package by going to http://railsinstaller.org.

If you scroll down the page, you will see that you have the options to install on Windows and Mac. We will go with Windows, the package that has Ruby 2.1 - and also Rails, Bundler, Git, DevKit and other tools.

  1. Download the Windows package by clicking on Ruby 2.1. Save and complete the installation process, by accepting all the default options. By the end, you should see a directory called C:\RailsInstaller

  2. Test to make sure Ruby was installed:

ruby -v
=> ruby 2.1.5p273
  1. Test to see which Rails version you got:
rails -v
=> 4.1
  1. We need to update Rails to version 4.2.3.
gem install rails -v 4.2.3

If you get an error about the SSL certificate, run the following commands:

gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
gem update --system

Then try to install Rails again

gem install rails -v 4.2.3

You can also install the SSL certificate following the instructions here: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages

Check if Rails installation went through:

rails -v
=> 4.2.3
  1. Check if Git was installed:
git --version
=> 1.9.4
  1. Next, we need to install PhantomJS. Go to http://phantomjs.org and download the right installer to your OS. Extract the files to the directory of your choice.

  2. It's necessary to add PhantomJS to your environment variable Path, so the executable can be invoked anywhere. Navigate to bin directory. There you will see phantomjs.exe.

  • Right click on the address bar and copy the address as text. If you extracted the files to C, for instance, the address will be C:\phantomjs-2.0.0-windows\bin
  • Click the Windows key and type "env". Select "Edit the system environment variables"
  • Click 'Environment Variables'
  • On "User variables for , select "path", click "Edit..." and them click "Edit text..."
  • By the end of that line, add a ; (semi-colon) and paste the address of phantomjs
  • Restart your console
  • Type phantomjs -v to see if everything is OK.

NOTE that any other environment variable that you need to add during this course, the steps are going to be exactly the same.

  1. We need to install Sublime Text, which is a nice editor to use. Got to http://sublimetext.com, click in 'Download' and pick the appropriate executable to your system. Save and run. After that, it is ready to use. Free alternative is GitHub Atom Editor(https://atom.io/) and ActiveState Komodo Edit(http://komodoide.com/komodo-edit/).

  2. One last step for Windows 64 bits: it is necessary to install NodeJS due to an incompatibility with one of Rails gems. Go to https://nodejs.org and download the installer to your system. Save and run. Node and NPM will be automatically added to the system path.

  3. Finally, lets test if everything is OK:

  • Open your console and create a new Rails app:

    rails new test_install
    
  • Update your Gemfile to say

    gem 'sqlite3', '1.3.13'
    

    instead of just

    gem 'sqlite'
    

    Then, run bundle update.

  • After that, start the Rails server:

rails s
  • On your browser, navigate to http://localhost:3000 and see if you find the Rails welcome page

That's all. Do not worry about the commands you just used. You will be given a lot more information on this as you start the course.