Yu-Chieh’s Blog (Y.C. Chang)

Ruby on Rails / Rubygems / FullStack / Git / Mac notes.

How to Install Ruby and Rails on Windows

在Windows上安裝ruby on rails開發環境

Easy and the quickest way.

install RailsInstaller

  1. Download it (version 3.0.0 and above are recommend) from http://railsinstaller.org
  2. install it (just click next and next steps, then done.).
  3. open “Git bash” console and run the following command.
1
$ curl http://installrails.com/update_rubygems.rb | ruby
  1. in “Git Bash” console run
1
$ gem update --system

about bundle errors (can not fetch gems from rubygems default source): how do we solve it?

  • Open and edit Gemfile after rails new app
  • Change the => source ‘https://rubygems.org’ to => source ‘http://rubygems.org
  • Add gem ‘coffee-script-source’, ‘1.8.0’ in Gemfile and run bundle update # original 1.9.1 wouldn’t work on windows platform.
  • done.

Harder way.

install RubyInstaller

  1. Download the package the version you want from http://rubyinstaller.org
    generally, we need to download Rubyinstaller and DevKit both (mind 32 or 64-bit platform).
  2. click to install rubyinstaller first and then DevKit.
    (記得勾選 Add Ruby…PATH / Associate .rb ….)
  3. Unzip DevKit under C:\
1
2
3
4
5
6
C:\> cd C:/DevKit
C:\> ruby dk.rb init
C:\> ruby dk.rb install
C:\> gem install json --platform=ruby 
C:\> gem install bundler
C:\> gem install rails --no-rdoc --no-ri
  • Done!!

Comments