Undefined method all_input_usages using libusb

I wrote this little demo code with libusb:

require 'libusb'

usb = LIBUSB::Context.new
device = usb.devices(:idVendor => 2362).first
puts device.all_input_usages

But somehow I don’t get the error:

 undefined method `all_input_usages' for #<LIBUSB::Device:0x2091fa8>

What did I do wrong?

  • Control USB ports
  • How Do I Install Ruby Gems on a USB Stick
  • Ruby libusb: Stall error
  • Porting Ruby USB code to latest versions of Linux?
  • Linux-Live-system inc. Ruby 1.9 on USB-Stick with r/w-Partition
  • Migrating an entire ruby/rails set up from one machine to another
  • One Solution collect form web for “Undefined method all_input_usages using libusb”

    You should step away from that demo code, because it is hopelessly outdated and the API has radically changed since.

    You can see all available methods in IRB when you type device.methods - Object.new.methods, it’s a trick i often use when i want to explore what an object has to offer. Maybe this will help you find the method you are looking for.

    Ruby is the best programming language in the world - Ruby on Rails.