DB2CLI.dll issues

Hello… I’m new to ruby, but love the style that things are done. :slight_smile:
I’ve programmed before but never with anything involving databases, so
I’m a bit lost on what do to with this. Basically, I’m trying to pass a
query to a db2 database and then have it return the results. I am unable
to do this however. Every time I run my script it says, “ruby.exe -
System error The program can’t start because DB2CLI.dll is missing from
your computer. Try reinstalling the program to fix this problem.” I’ve
followed the instructions for installing the gems I needed based on what
I’ve seen on the net, but I really have no clue where to start on this.

My reason for creating the application is to query and print out
information on a user from 4 different servers.

After commenting out the code involving db2, I seem to be getting errors
with really ANY “required” gem though. For instance, using highline to
block out password works fine in irb and works fine if I call it like
“ruby -r rubygems UserInfo.db” but it doesn’t work if I just run it
through aptana. Is my installation of ruby/aptana/git/etc… broken, or
is this just some stupid novice mistake I’ve made. ^^;;

Here is the code and also the os/ruby version.

Windows7 Pro 64-bit
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
git version 1.7.11.msysgit.1
Aptana Studio 3, build:


require ‘rubygems’
require ‘net/ssh’
require ‘mswin32/ibm_db’
require ‘highline/import’

#Functions for ssh and db query
def ssh_exec_return(hostname,username,password,cmd)
ssh = Net::SSH.start(hostname, username, :password => password)
out = ssh.exec!(cmd)
puts out
puts “Unable to connect to #{hostname}! Maybe check your
return res

#db query func
def run_select_query(query,host,username,password,dbname)

connection = nil

connection = IBM_DB.connect(“DRIVER={IBM DB2 JDBC
“”, “”)
rescue IBM_DB::DatabaseError => e
puts “An error occurred”
puts “Error code: #{e.err}”
puts “Error message: #{e.errstr}”

dataset = IBM_DB.exec(connection,query).fetch_all
return dataset

puts “This utility will output LME and Intraweb permissions, as well as
output which distribution lists a user is a member of. Just a few
first though.”
puts “What is the users uid?”
@UID = gets.chomp
puts “What is the Users email?”
@EMAIL = gets.chomp
puts “What is the root password”
@ROOT_PASS = ask("=>") { |q| q.echo = false }
puts “What is your username?”
@ADMIN_USER = gets.chomp
puts “What is your Password?”
@ADMIN_PASS = ask("=>"){ |q| q.echo = false }
puts “ALRIGHT! The Information will now be queried”

run_select_query(“select * from group_membership where

puts “----User Login.bat Contents----”
puts “----Zimbra User Email Groups----”
zmprov gam #{@EMAIL}”)

I’m sure you’ll find a lot of mistakes in what I’m doing. ^^;; But this
is one of those things that is stupidly long to do manually when it
could be done pragmatically… I’m a help desk person and the programmers
have higher priority things to achieve. ^^;;;