I use IronRuby  :

require "mscorlib"
require "System.Windows.Forms"



 def portConfigure(portName,bauds,bits,stop,parity)
    @components = System::ComponentModel::Container.new()
    @serialPort1 = System::IO::Ports::SerialPort.new(@components)
    portName ||= "COM3"
    bauds ||= "9600"
    bits ||= "8"
    stopBits ||= "1"
    parity ||= "none"
    #puts "Configure..."
    @serialPort1.DtrEnable = true
    @serialPort1.RtsEnable = true
    @serialPort1.PortName = portName
    @serialPort1.StopBits = stopBits.to_i
    @serialPort1.BaudRate = bauds.to_i
    @serialPort1.DataBits = bits.to_i
    @serialPort1.Open()
    @serialPort1.DataReceived do |sender, e|
       buff = @serialPort1.ReadExisting()
       scanner(buff)
    end
  end
  def writeString(str)
    buf = System::Text::Encoding.GetEncoding("ASCII").GetBytes(str)
    size = buf.Length
    @serialPort1.Write(buf, 0, size)
  end

-- 
Posted via http://www.ruby-forum.com/.