From: Brian Candler Date: 2009-04-16T16:31:49+09:00 Subject: Re: querying using HTTP Peter Bailey wrote: > I'm querying a graphics database using http. ... and ruby 1.9.1, it appears > On my server and on my PC, > I can successfully run a simple script that checks for the existence of > files in different formats—PDF, PNG, and TIFF. But, when my colleagues > run this same script, they get the error I display below. ruby 1.9's runtime behaviour of anything using String varies depending on the environment it runs in. It is quite difficult to get it behave sanely, and is such a mess that I stick with ruby 1.8. I think this is particularly likely to be your problem given that you are handling binary data. You could try looking at the body of the 400 response to see if it has any more detail about what's gone wrong (that is, check Response#body before Response#value), or you could use wireshark to look at the actual packets going back and forth. Compare what you see on the working machine with the non-working one. If you are reading any data from local files on disk before posting, you could try File.open(name,"rb"). You could also try adding "# encoding: UTF-8" to the top of your source file, and also running your script using ruby -Kn script.rb If those don't work, then I'd suggest you stick with ruby 1.8 for the next year or so. -- Posted via http://www.ruby-forum.com/.