title: using ruby and stomp to write messages to ActiveMQ
body: <p>I'm using stomp to write messages to ActiveMQ from Ruby. I'm following example at
  <a href="http://calliopesounds.blogspot.com/2009/07/working-ruby-stomp-example.html" rel="nofollow">http://calliopesounds.blogspot.com/2009/07/working-ruby-stomp-example.html</a> </p>
  
  <p>But i'm getting the below error, not sure what is wrong </p>
  
  <pre><code>/Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `write': Invalid argument (Errno::EINVAL)
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `puts'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `_transmit'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `each'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `_transmit'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:445:in `synchronize'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:445:in `_transmit'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:427:in `transmit'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:267:in `publish'
      from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/client.rb:200:in `publish'
      from utils.rb:10
  </code></pre>
  
  <p>here is the script</p>
  
  <pre><code>require 'rubygems'
  require 'stomp'
  
  queue = "/queue/msg.in"
  
  puts "Producer for queue #{queue}"
  
  client = Stomp::Client.open "stomp://localhost:61616"
  puts client
  client.publish queue, "hello!"
  client.close
  </code></pre>