Have Ruby on Rails Installed on Windows the Best Way

This is a complete step by step instructions with minimal explanations, on how to set up your Windows machine for starting building your RoR application in the most efficient and professional way.

Most of this is inspired from the Michael Hurtl most recommended Rails book 

1. Download and install RailsInsaller

2. Download and install Console 2

3. Download and install Sublime Text 2

4. Download and install Herkou Toolbelt

5. Open Console 2

6. Navigate through cd commands to a folder where you want your app folder to be created

7. Run rails new applicationname (will create the application directory with all rails default sub-directories and files)

8. Open gemfile with Sublime Text 2 and change as per your required gems. I found the gemfile used by Rails tutorial book is perfect to use in every application, then add gems when you need later. But make sure you:
  – remove rb-fsevent, growl, rb-inotify, libontify
  – add 

gem ‘rb-fchange’, ‘0.0.5’
gem ‘rb-notifu’, ‘0.0.4’
gem ‘win32console’, ‘1.3.0’

Google the pages of these gems to check their latest version and change the version number accordingly

9. Navigate with Console 2 to your newly created app folder and run bundle install

10. Run rails s

Congratulations you now have rails server running with some beautiful essential gems.

11. git init

12. git add .

13. git commit -m “Initial commit”

14. Create git account on github

15. git remote add origin https://github.com/%5Busernane%5D/%5Brepositaryname%5D.git

16. git push -u origin master

Congratulations you have just set up Git to work smoothly with your app.

17. Create a heroku account

18. Run heroku login on console 2

19. heroku create

20. git push heroku master

Congratulations you have hosted your app on Heroku.

The most recommended testing environment is rspec, and here is the best way to install it with the best supporting gems and options.

21. In console 2, run rails generate rspec:install

22. bundle exec guard init rspec (guard gem for autotesting)

23. change content of guardfile to the one used in the tutorial

24. bundle exec spork –bootstrap (spork gem for speeding up tests)

25. Change content of spec/spec_helper.rb to the one used in the tutorial

26. Change content of .rspec file to 


27. bundle exec guard init spork (to tell rails to use spork with guard)

28. add :cli => ‘–drb’ argument to guard ‘rspec’ line in guardfile

29. In sublime text 2 go to preference -> Package Control and select install package find  rubytest and have it installed.

30. preference -> Package Settings->RubyTest->Settings – User add bundle exec before any rspec you find

Congratulations you now have rspec testing framewrok installed with the best supporting gems to autotest, notify, and speed things up. You can also now run tests from Sublime Text 2 itself.

In thirty steps you now have everything ready for the best development environment on Windows for any serious application development.Image


2 responses to “Have Ruby on Rails Installed on Windows the Best Way

  1. => Booting WEBrick
    => Rails 3.2.16 application starting in development on
    => Call with -d to detach
    => Ctrl-C to shutdown server
    C:/Users/EJ/Desktop/Console2/toy_app/config/environment.rb:5:in `’: undefined method `application’ for Toyapp:Module (NoMethodError)
    from C:/Users/EJ/Desktop/Console2/toy_app/config.ru:3:in `require’
    from C:/Users/EJ/Desktop/Console2/toy_app/config.ru:3:in `block in ‘
    from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.4.5/lib
    /rack/builder.rb:51:in `instance_eval’
    from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.4.5/lib
    /rack/builder.rb:51:in `initialize’
    from C:/Users/EJ/Desktop/Console2/toy_app/config.ru:in `new’
    from C:/Users/EJ/Desktop/Console2/toy_app/config.ru:in `’
    from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.4.5/lib

  2. I’ve finally follow your steps you just need to use ruby 1.9.3 in rails installer but how do I make sublime 2 run ruby test it’s not working ctrl+shift+t and ctrl+shift+r thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: