Getting started with Ruby on Windows

The life takes us through different and mysterious ways. In this occasion that way has lead me to Ruby world.

So, here are the steps I perform to get my Ruby development environment up and running on Windows 7.

I started by downloading Ruby from http://rubyinstaller.org/. In my case and because of the context of my project I choose Ruby 1.8.7.

image

The installation was very straightforward: accept the license, ensure to check the “Add Ruby executables to your PATH” option and press install.

image

After a couple a seconds the following screen displayed telling that the installation was completed.

image

The next component to install was the DevKit, a set of tools to allow the usage of C-native features in Ruby. The installation of this component was not so straighforward, I had to follow the instructions detailed here: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.

With this, we can say that the base infrastructure is ready, but it is not enough to develop applications. We will need to install gems (this is name given to Ruby packages). To install gems we can use RubyGems package manager that comes with Ruby installation. To use it, just open a Commmand Prompt and type the command to execute. In my case case I installed some tools that I already new I wanted to use:

  • Sinatra: a DSL tools to create web applications
  • Data Mapper: a persistence framework
  • Bundler: a tool to manage application dependencies
  • Heroku gem: a package to interact with Heroku platform

To install all this gems, just execute the following script:

gem install sinatra
gem install data-mapper
gem install bundler
gem install heroku

If while installing any of these gems you get an error telling “invalid date format in specification”, you will have to go to follow these steps:

  1. Go to <ruby folder>librubygems1.8specifications.
  2. Find the file mentioned in the error and open it.
  3. Look for a line assigning a date, something like s.date = %q{2011-08-17 00:00:00.000000000Z}
  4. Modify that line and remove the time s.date = %q{2011-08-17}
  5. Save the file and you are ready.

Well folks, that’s all, you are almost ready to start working. I say almost because you may want to install an IDE. But that will be the topic of another post.

To be continue….

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.