ERROR: Failed to build gem native extension.
globocomgithub opened this issue · 1 comments
Hi, when I try to install the libusb gem the following error occurs:
12:49:11 ~/Dropbox/CRuby/usb $ gem install libusb
Fetching: ffi-1.9.8.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.8
Fetching: libusb-0.5.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing libusb:
ERROR: Failed to build gem native extension.
/Users/francisco/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150406-11787-1hfg5ft.rb extconf.rb
checking for libudev.h... no
sh configure --disable-udev --prefix=/Users/francisco/.rvm/gems/ruby-2.2.1@usb/gems/libusb-0.5.0 && make && make install
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
.
.
.
config.status: executing libtool commands
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libusb
CC libusb_1_0_la-core.lo
CC libusb_1_0_la-descriptor.lo
CC libusb_1_0_la-io.lo
CC libusb_1_0_la-strerror.lo
CC libusb_1_0_la-sync.lo
CC libusb_1_0_la-hotplug.lo
CC os/libusb_1_0_la-threads_posix.lo
CC os/libusb_1_0_la-darwin_usb.lo
In file included from /usr/include/dispatch/dispatch.h:51:0,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
from /System/Library/Frameworks/IOKit.framework/Headers/IOCFBundle.h:26,
from os/darwin_usb.h:26,
from os/darwin_usb.c:43:
/usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
typedef void (^dispatch_block_t)(void);
^
/usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
dispatch_block_t notification_block);
^
.
.
.
os/darwin_usb.c: In function 'darwin_abort_transfers':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device ) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1703:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
^
make[2]: ** [os/libusb_1_0_la-darwin_usb.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
extconf.rb:46:in rescue in <main>': libusb build exited with 2 (RuntimeError) from extconf.rb:16:in
extconf failed, exit code 1
Im using a mac with yosemite:
Darwin Mac247300.local 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47 PST 2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64
(master) 13:12:52 ~/Dropbox/CRuby/usb/libusb $ brew list libusb
/usr/local/Cellar/libusb/1.0.19/include/libusb-1.0/libusb.h
/usr/local/Cellar/libusb/1.0.19/lib/libusb-1.0.0.dylib
/usr/local/Cellar/libusb/1.0.19/lib/pkgconfig/libusb-1.0.pc
/usr/local/Cellar/libusb/1.0.19/lib/ (2 other files)
clang --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
gcc --version
gcc (GCC) 4.9.2 20141029 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Do you can help me
Reinstalled gcc and BANG ... works perfectly...
Thanks...