ruby-nxt 0.8.1 - Finally available as a Gem 4

Posted by Tony Buser Sat, 04 Nov 2006 04:05:00 GMT

I've been pretty busy lately so haven't had much time to work on ruby-nxt. However, tonight I had some time to finally get it packaged into a gem! The main reason it took so long is because of some kind of weird bug with requiring ruby-serialport and rubygems resulting in the following error:

NameError: (eval):1:in `private_class_method': undefined method `create' for class `Class'
        from (eval):1
        from (eval):1
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from (irb):2

For some reason, it doesn't like rubygem's custom require code. So I got around it by doing a Kernel::require "serialport".

Unfortunately, there's really no way to include ruby-serialport in the ruby gem, so you'll still have to download and install that seperately. Once serialport is installed, all you should have to do is sudo gem install ruby-nxt. Then in your code require "rubygems" then require "nxt_comm" or require "nxt" depending on how you want to use it.

The 0.8.1 release doesn't have anything new in terms of features, however you might want to take a look at examples/drb_server.rb ;)

Trackbacks

Use the following link to trackback from your own site:
http://www.juju.org/articles/trackback/875

Comments

Leave a response, Track co.mments

  1. Avatar
    Jake Good Sun, 05 Nov 2006 17:42:46 GMT

    nice job! congrats on the gem release...

  2. Avatar
    Nick Kijak Sun, 12 Nov 2006 18:55:27 GMT

    I think nxt.rb's requires are wrong in the gem for the lightsensor and ultrasonicsensor. I got an error with the gem, but when I dl'd the code and changed the paths it worked OK.

  3. Avatar
    Tony+Buser Mon, 13 Nov 2006 16:38:27 GMT

    What error do you get?

  4. Avatar
    radix Thu, 23 Nov 2006 20:34:20 GMT

    Hey cool, this is very useful :)

    I wrote a simple bulk usb driver for nxt for linux (i am using usb to communicate with my nxt), so I don't really need serial stuff -just reading/writing from /dev/legonxt using some of your code.

Comments