You need to allow command line access to bitcoind because the program needs to automatically check whether the password works. See here:
https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File
Basically you need to create a textfile named bitcoin.conf in C:\Users\username\AppData\Roaming\Bitcoin\ (change username to your username)
In the textfile you probably only need:
rpcuser=somename
rpcpassword=somepassword
Make the password a long gibberish thing
Once you have that file, open a command window (start, type cmd in the box, and select cmd.exe)
then type:
cd C:\Users\username\AppData\Roaming\Bitcoin\ (replacing username)
bitcoind --daemon
Count to 10 and type
bitcoind getinfo
If it gives you some information (current block, etc) that means you're connected and you can then run the ruby script
If it says not connected then count to 10 and try again.