The error means that there is no class or module named USB
. The instructions you referred to seem to use an older version of libusb
that originally defined the USB
module.
Here's how to do it in newer versions of libusb
:
require 'libusb'
usb = LIBUSB::Context.new
usb.devices.each{ ... }