Install Ruby and RabbitMQ Ruby Client on Windows 7

A scientist of our company insists on using Windows 7 instead of our development Linux platform and Ruby scripting instead of our Java development language in prototyping his algorithm module. We need to use RabbitMQ as our inter-node communication method and thus I need to find a good client for him. Therefore, I was forced by myself actually to learn Ruby on Windows 7. Good thing is that I get a chance to learn something new. Maybe one day later when I have to switch to Ruby on Windows, I have something can help.

1. Install Ruby environment.

A lot of internet users who had similar experiences suggested using RubbyInstaller as the Ruby environment. I followed their advice and installed the RubyInstaller 1.9.3. Installation was very smooth and successful. Under Windows “Start –> All Programs –> Ruby 1.9.3-p545” there are the following two items for Ruby

  • Interactive Ruby: an interactive console for running Ruby interactively
  • Start Command Prompt with Ruby: a Ruby enabled Windows terminal console allows to install various Ruby module gems and run Ruby programs.

2. Start “Interactive Ruby” as any Windows applications, you will see the Ruby interactive console pop-out and you can type in any Ruby statements and get executed.

3. Start ” Start Command Prompt with Ruby” and install Ruby gems

In the pop-out console, do

  • gem install eventmachine
  • gem install amqp

This will install the two Ruby modules of Ruby RabbitMQ client.

4. Test run the installed Ruby RabbitMQ client.

Put your Ruby codes into a Ruby file, e.g. test.rb and then run

ruby test.rb

in the ” Start Command Prompt with Ruby”  console, the Ruby program is run.