Ruby WMQ.

Ruby interface into WebSphere MQ (MQSeries) ®

Installing

Ruby Gems Installation

 

The best way to install Ruby WMQ is through the Ruby Gems infrastructure. At the command line enter:

gem install rubywmq

(For instructions on installing Ruby Gems, if not already installed,  see details further below)

The following output should be displayed:

Bulk updating Gem source index for: http://gems.rubyforge.org

Select which gem to install for your platform (i386-mswin32)

 1. rubywmq 0.3.0 (i386-mswin32-mq6)

 2. rubywmq 0.3.0 (i386-mswin32-mq5.3)

 3. rubywmq 0.3.0 (sparc-solaris2.8-mq5.3)

 4. rubywmq 0.3.0 (ruby)

 5. Skip this gem

 6. Cancel installation

>

NOTE: The above binaries will only work on Ruby 1.8.4 or above.

For older versions of Ruby please build from source code by selecting the “rubywmq 0.3.0 (ruby)” option

Windows:

Libraries are available for both MQ 5.3 and MQ 6.  The MQ 6 library will allow use of the options specific to MQ 6. The MQ 5.3 library will work with both WebSphere MQ V 5.3 and V6.

For MQ 5.3, select gem with platform: i386-mswin32-mq5.3

For MQ 6, select gem with platform: i386-mswin32-mq6

If in doubt, select gem with platform i386-mswin32-mq5.3 since it will work with the newer WebSphere MQ versions anyway.

 

Solaris Sparc:

To install the prebuilt binaries for Solaris on Sparc Processors, select gem with platform: sparc-solaris2.8-mq5.3

This will install RubyWMQ that will work with MQ5.3 and greater.

 

All other platforms and to build from Source Code:

Note: Prior to running gem install, ensure that the compiler is in the current path.

E.g. For windows run the following command prior to performing the install: "C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"

The gem package install assumes that MQ is installed in the default location. If not, perform the install and when the build fails follow the “Building” instructions to update the paths and build the package.

Select gem with platform: ruby, the output should be similar to:

Building native extensions.  This could take a while...

Successfully installed rubywmq-0.3.0

Installing ri documentation for rubywmq-0.3.0...

Installing RDoc documentation for rubywmq-0.3.0...

See the page “Building” for details on how to build from source code

 

Post-Installation

· After installing using Ruby Gems it is recommended on UNIX/Linux systems to add the following line to the user profile (e.g. .profile):
export RUBYOPT=rubygems

 

To test the installation on Windows:

(Path names below will vary per system and by platform selected during the gem install step above)

1. cd C:\ruby\lib\ruby\gems\1.8\gems\rubywmq-0.3.0-i386-mswin32-mq5.3\tests

2. notepad test.rb

3. Change REID to the name of a local Queue Manager

To test over a client connection, change the following line:
   
@queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'REID') #, :connection_name=>'localhost(1414)')
To:
   
@queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'REID', :connection_name=>'localhost(1414)')

I.e. Remove the commented out :connection_name to create the client connection.

Update the queue manager name, connection_name and channel_name as required to connect to the local/remote queue manager.

4. ruby test.rb

 

To test the installation on UNIX/Linux:

(Path names below will vary per system and by platform selected during the gem install step above)

1. cd /usr/local/lib/ruby/gems/1.8/gems/rubywmq-0.3.0/tests
(
rubywmq-0.3.0 varies by release and platform)

2. vi test.rb

3. Change REID to the name of a local Queue Manager

To test over a client connection, change the following line:
   
@queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'REID') #, :connection_name=>'localhost(1414)')
To:
   
@queue_manager = WMQ::QueueManager.new(:q_mgr_name => 'REID', :connection_name=>'localhost(1414)')

I.e. Remove the commented out :connection_name to create the client connection.

Update the queue manager name, connection_name and channel_name as required to connect to the local/remote queue manager.

4. ruby test.rb

 

Installing Ruby Gems:

Ruby Gems code can be downloaded from RubyForge:

http://rubyforge.org/frs/download.php/16452/rubygems-0.9.1.tgz

Or, the latest release can be obtained from:
http://rubyforge.org/frs/?group_id=126&release_id=9074

1. gunzip rubygems-0.9.1.tgz

2. tar-xvf rubygems-0.9.1

3. cd rubygems-0.9.1

4. ruby setup.rb            (Needs to be run with root privileges or sudo)

For systems where Ruby Gems has not been installed, the files can be extracted from the gem file itself.

To extract the files from the gem:

1. Download the .gem file from RubyForge

2. gunzip filename.gem

3. gunzip data.tar.gz | tar -xv

 

Download

Ruby WMQ sources are available via an ftp download from:

  http://rubyforge.org/projects/rubywmq/

Downloads available:

· Source package

· Needs to be built using a C compiler

· Requires the WebSphere MQ Software development toolkit

· Binary packages

· Ruby Gem Pre-built packages are available for:

· Windows

· Solaris 8

· Others on demand and system availability.

· To bypass the gem process and extract the contents directly:

· On Windows, rename 'filename.gem' to 'filename.zip' and extract using your favorite uncompress utility.

· A good tool is WinRAR  http://www.rarlab.com

Source code

The source code for each release is available for download from the download site above.

The latest code is always accessible from the Subversion repository on RubyForge:

    svn checkout svn://rubyforge.org/var/svn/rubywmq/trunk