Ruby-usb gems

Posted by aslak.hellesoy

I’ve packaged ruby-usb as gems, available both for Windows an *nix/linux/os x

gem install ruby-usb # On *nix/linux/os x you must first install Lib-USB

At one of the projects in BEKK we bought a Betabrite Prism sign to display the status of builds. Getting the Betabrite Gem to work via USB on Windows was a bit of a challenge. I got around it, so I’d like to share it with others.

The first hurdle was to get Ruby-usb to work on Windows. Ruby-usb is a Ruby library that uses the Lib-USB C library. Ruby-usb wasn’t available as a binary gem (with compiled C extensions), so I figured I had to make one myself. Luckily there is a Windows port of Lib-USB, and I decided to try to build Ruby-usb’s C extensions against that library.

After a lot of reading and trial and error I finally realised I had to build Ruby-usb’s C extensions with MinGW and MSYS. I even had to build Ruby itself with MinGW/MSYS in order to get rbconfig to work. These tools are great alternatives to Cygwin, as they produce “pure” win32 binaries.

With a working Ruby-usb gem for Windows I tried out the Betabrite gem, and found a little bug that has now been fixed.

So I ended up having to fork Tanaka’s original Ruby-usb project. The code is on Gitorious and the Gem on Rubyforge. Forking is something I hate to do, but I haven’t been able to get in touch with Tanaka, and it seemed like the only way to publish Ruby-usb as gems.

Matz is coming to Oslo!! 2

Posted by aslak.hellesoy

The creator of Ruby, Yukihiro Matsumoto is coming to RubyFools Oslo on April 3-4 2008. This is fantastic news – I’m reaqlly looking forward to that. If you haven’t signed up for the conference, hurry up! There are only 150 seats available. (The program will be updated soon with Matz’ talk).

I’m psyched!