Skip to content

Instantly share code, notes, and snippets.

@omgreenfield
Last active June 16, 2017 17:03
Show Gist options
  • Save omgreenfield/442d17652908c15d5b426606896649d5 to your computer and use it in GitHub Desktop.
Save omgreenfield/442d17652908c15d5b426606896649d5 to your computer and use it in GitHub Desktop.
Installing Rails on Windows

Download Ruby Installer and DevKit

  1. Go to http://rubyinstaller.org/downloads/
  2. Download an install for ruby. For example, for 2.3.1, get rubyisntaller-2.3.1.exe
  3. Download the DevKit

1. Initialize

  1. Run the rubyinstaller.exe. It'll create a folder like C:\ruby23 for version 2.3.x
  2. Create a folder in that C:\ruby23 folder called "devkit", put the devkit.exe in there, and run it
  3. Open a command window in that devkit folder and run ruby dk.rb init. This will create a config.yml file. You may need to put the path to this Ruby instance, but it might have done it for you already
  4. Run ruby dk.rb install

2. Install some gems

gem install rails

gem install bundler

3. Set SSL Cert

Follow instructions here: https://gist.github.com/fnichol/867550

Make sure to set environment variable SSL_CERT_FILE (not just in the command line)

Why not just use Railsinstaller?

You can. It just has some broken code in it. If you use railsinstaller, you might run into the error The system cannot find the path specified. If you do, check out this link: http://stackoverflow.com/questions/35545361/rails-the-system-cannot-find-the-path-specified

Basically, the railsinstaller\ruby\bin folder has several .bat files with a reference to C:\Users\emachnic. Gotta change the directory to refer to your ruby's bin folder.

Still not working?

Are you running it with Powershell? Try running it in regular command prompt. There is a bug with rails being unable to find files because the paths are forced lowercase in Powershell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment