Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Unable to find foreign function in rubinius

View Problematic code (assumption)
1 2 3 4 5 6 7 8
typedef :pointer, :libusb_context
typedef :pointer, :libusb_device_handle
 
attach_function 'libusb_set_configuration', [:libusb_device_handle, :int], :int, :blocking=>true
attach_function 'libusb_claim_interface', [:libusb_device_handle, :int], :int
attach_function 'libusb_release_interface', [:libusb_device_handle, :int], :int, :blocking=>true
[…]
attach_function 'libusb_handle_events', [:libusb_context], :int, :blocking=>true
View Problematic code (assumption)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
$ ruby -rlibusb -e ''
An exception occurred requiring command line files
Unable to find foreign function '[:libusb_device_handle, :int]' (FFI::NotFoundError)
 
Backtrace:
FFI::Library(Module)#ffi_function_missing at kernel/delta/ffi.rb:9
FFI::Library(Module)#attach_function at kernel/platform/library.rb:130
LIBUSB::Call.__module_init__ (Call) at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:192
LIBUSB.__module_init__ (LIBUSB) at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:21
Object#__script__ at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:19
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
Kernel(Module)#gem_original_require (require) at kernel/common/kernel.rb:648
Kernel(Module)#require at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/lib/rubygems/custom_require.rb:36
LIBUSB.__module_init__ (LIBUSB) at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb.rb:19
Object#__script__ at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb.rb:16
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212
Kernel(Rubinius::Loader)#gem_original_require (require) at kernel/common/kernel.rb:648
Kernel(Rubinius::Loader)#require at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/lib/rubygems/custom_require.rb:60
{ } in Rubinius::Loader#requires at kernel/loader.rb:568
Array#each at kernel/bootstrap/array.rb:68
Rubinius::Loader#requires at kernel/loader.rb:568
Rubinius::Loader#main at kernel/loader.rb:814
View Problematic code (assumption)
1 2 3 4 5 6 7 8 9 10 11 12 13
diff --git a/lib/libusb/call.rb b/lib/libusb/call.rb
index e0604b7..252ee86 100644
--- a/lib/libusb/call.rb
+++ b/lib/libusb/call.rb
@@ -21,7 +21,7 @@ module LIBUSB
module Call
extend FFI::Library
- if FFI::Platform.windows?
+ if FFI::Platform::OS == 'windows'
bundled_dll = File.join(File.dirname(__FILE__), '..', 'libusb-1.0.dll')
ffi_lib(['libusb-1.0', bundled_dll])
else
View Problematic code (assumption)
1 2 3 4 5 6 7 8 9 10 11 12 13
diff --git a/lib/libusb/call.rb b/lib/libusb/call.rb
index e0604b7..252ee86 100644
--- a/lib/libusb/call.rb
+++ b/lib/libusb/call.rb
@@ -21,7 +21,7 @@ module LIBUSB
module Call
extend FFI::Library
- if FFI::Platform.windows?
+ if FFI::Platform::OS == 'windows'
bundled_dll = File.join(File.dirname(__FILE__), '..', 'libusb-1.0.dll')
ffi_lib(['libusb-1.0', bundled_dll])
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.