# Ruby Examples Not Working Libusb Not Supported

**URL:** <https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707>\
**Category:** Uncategorized\
**Created:** [March 16, 2017, 7:46pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707 "2017-03-16T19:46:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dunkyoung25](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/dunkyoung25/32/236_2.png) [@dunkyoung25](https://forums.blinkstick.com/u/dunkyoung25)\
**Post date:** [March 16, 2017, 7:46pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/1 "2017-03-16T19:46:01Z")

</div>

@arvydas Ime trying out the ruby examples but seems i cant install the ruby gem libusb as its no longer supported in the Ruby 1.9.3,ive also tryed the latest ruby wich will install the libusb gem but doesnt find blinkstick eather,so weather ime doing somthing wrong or its now broke and needs updating.any help with this would be great.

---

<div class="post-metadata">

**Author:** ![p0ke](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/p0ke/32/14_2.png) [@p0ke](https://forums.blinkstick.com/u/p0ke)\
**Post date:** [March 17, 2017, 7:15pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/2 "2017-03-17T19:15:52Z")

</div>

I´m using ruby 1.9.3 and I am able to install libusb without any problems. For me everything regarding blinkstick works fine with Ruby versions 1.9.3 and 2.2.6

---

<div class="post-metadata">

**Author:** ![dunkyoung25](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/dunkyoung25/32/236_2.png) [@dunkyoung25](https://forums.blinkstick.com/u/dunkyoung25)\
**Post date:** [March 18, 2017, 2:42pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/3 "2017-03-18T14:42:29Z")

</div>

@p0ke Hi,its saying libusb isnt supported in this version,ile try another.

---

<div class="post-metadata">

**Author:** ![dunkyoung25](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/dunkyoung25/32/236_2.png) [@dunkyoung25](https://forums.blinkstick.com/u/dunkyoung25)\
**Post date:** [March 18, 2017, 2:58pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/4 "2017-03-18T14:58:03Z")

</div>

@p0ke The error is \> error installing libusb  
ffi requires ruby version \<2.5 , \>=.2.0.

and bug segmentation fault.

wich version of 193 p ? do i install there a quite a few? thanks in advance @p0ke.

---

<div class="post-metadata">

**Author:** ![dunkyoung25](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/dunkyoung25/32/236_2.png) [@dunkyoung25](https://forums.blinkstick.com/u/dunkyoung25)\
**Post date:** [March 18, 2017, 4:08pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/5 "2017-03-18T16:08:21Z")

</div>

@p0ke 226 installs all fine now,but i get raise:error bellow.

C:\Users\Dunk\Desktop\blinkstick-ruby-master\>ruby example-pro-run.rb  
Enter channel (R=0, G=1, B=2): 0  
Enter number of LEDs: 2  
C:/Ruby22/lib/ruby/gems/2.2.0/gems/libusb-0.6.2-x86-mingw32/lib/libusb/constants  
.rb:62:in `raise_error': LIBUSB::ERROR_INVALID_PARAM in libusb_submit_transfer ( LIBUSB::ERROR_INVALID_PARAM) from C:/Ruby22/lib/ruby/gems/2.2.0/gems/libusb-0.6.2-x86-mingw32/lib/lib usb/transfer.rb:202:in`submit!’  
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/libusb-0.6.2-x86-mingw32/lib/lib  
usb/transfer.rb:229:in `submit_and_wait' from C:/Ruby22/lib/ruby/gems/2.2.0/gems/libusb-0.6.2-x86-mingw32/lib/lib usb/dev_handle.rb:544:in`submit\_transfer’  
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/libusb-0.6.2-x86-mingw32/lib/lib  
usb/dev\_handle.rb:525:in `control_transfer' from C:/Users/Dunk/Desktop/blinkstick-ruby-master/blinkstick.rb:64:in`s  
et\_color’  
from example-pro-run.rb:44:in `’

C:\Users\Dunk\Desktop\blinkstick-ruby-master\>

---

<div class="post-metadata">

**Author:** ![p0ke](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/p0ke/32/14_2.png) [@p0ke](https://forums.blinkstick.com/u/p0ke)\
**Post date:** [March 18, 2017, 6:36pm UTC](https://forums.blinkstick.com/t/ruby-examples-not-working-libusb-not-supported/707/6 "2017-03-18T18:36:21Z")

</div>

It is a bit tricky to get it to work under windows.  
For your problem take a look at the solution here:

> <https://github.com/larskanis/libusb/issues/7>
>
> Hello
> 
> I am trying to update my blinky gem (https://github.com/perryn/blinky) to… use the your libusb gem as a way of getting windows support that actually works.
> 
> Unfortunately everything works great on OSX, but I am still having trouble on windows.
> 
> I am trying to use a Delcomm USB light on Windows 7 
> - when I plug in the light it detected it and automatically installed a driver
> - as a result Zadig didn't recognize any devices that needed drivers (and the full list didn't seem to contain anything that looked replaceable)
> 
> So I thought maybe the driver it automagically installed might work - and indeed my gem is able to detect the light - but if I try to send it a command I get this:
> 
> \`\`\`
> LIBUSB::ERROR\_INVALID\_PARAM: LIBUSB::ERROR\_INVALID\_PARAM in libusb\_submit\_transfer
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libusb-0.2.2-x86-mingw32/lib/libusb/constants.rb:46:in \`raise\_error'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libusb-0.2.2-x86-mingw32/lib/libusb/transfer.rb:135:in \`submit!'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libusb-0.2.2-x86-mingw32/lib/libusb/transfer.rb:162:in \`submit\_and\_wait!'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libusb-0.2.2-x86-mingw32/lib/libusb/dev\_handle.rb:390:in \`control\_transfer'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libusb-0.2.2-x86-mingw32/lib/libusb/compat.rb:316:in \`usb\_control\_msg'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/blinky-0.0.4/lib/device\_recipes/delcom\_engineering/visual\_indicator\_gen\_two.rb:28:in \`set\_colour'
> from C:/Ruby193/lib/ruby/gems/1.9.1/gems/blinky-0.0.4/lib/device\_recipes/delcom\_engineering/visual\_indicator\_gen\_two.rb:7:in \`success!'
> from (irb):5
> from C:/Ruby193/bin/irb:12:in \`\<main\>
> \`\`\`
> 
> any pointers would be grafefully received.
