How To Install Ruby On Rails On Windows [ tutorial ]

In this tutorial I’ll show you how to install ruby on rails on windows .just follow these steps , to get up and running rails on windows .

Steps

1 : first  download ruby installer for windows  from  : http://rubyinstaller.org/
and download DevKit from http://rubyinstaller.org/add-ons/devkit/
and extract and run the post install script from post-install directory

 

 

I’ll use Ruby1.9.3-p194

check box ( Add Ruby Executable to your path ) when installing  Ruby , that will add ruby on your PATH .

2 : verify installation open CMD and type

ruby -v

 

3: after that check gem version and if it needed update gems

gem -v 

gem update --system

 

4 : install rails gem

gem install rails
5: install SQLite 3 because Rails  uses SQLite3 as a default  Database
gem install sqlite3
6:  install mysql gem
gem install mysql
#In case of problem 
gem install mysql –platform=ruby — –with-mysql-dir=C:\mysql  

or change the directories path according you MySQL installation

download c connector from here

http://dev.mysql.com/downloads/mirror.php?id=377977and extract /lib/libmysql.dll into your c:rubybin folder

7 : install git . for version control and code tracking  download windows version from here
8 : create new rails app
  • rails new demo_app 
  • if you are getting Gem::InstallError: The ‘json’ native gem requires installed build tools.
  • don’t panic just add devkit in your environment PATH
  • add c:devkit  in your environment PATH and open CMD and type gem install json -v ‘1.7.3’
  • if it fail to install install it from using C:devkitmysys.bat
  • type rails -s 
  • open browser and navigate to http://localhost:3000 
Enjoy Riding!
Tagged With : - - -
Add Comment