hexdigest / ruby-nfc

NFC library for Ruby programming language
MIT License
34 stars 8 forks source link

ruby-nfc for Rpi3 installs ffi-0.6.4 which is not compatible with arm #6

Closed xetum closed 7 years ago

xetum commented 7 years ago

Hi, I'm having problems installing:

gem install --user-install ruby-nfc

Building native extensions. This could take a while... ERROR: Error installing ruby-nfc: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 extconf.rb

extconf.rb:6:in <main>': Use RbConfig instead of obsolete and deprecated Config. extconf.rb:6:in

': Use RbConfig instead of obsolete and deprecated Config. checking for ffi_call() in -lffi... yes checking for ffi_prep_closure()... yes checking for ffi_raw_call()... yes checking for ffi_prep_raw_closure()... yes checking for rb_thread_blocking_region()... yes creating extconf.h extconf.rb:24:in `
': Use RbConfig instead of obsolete and deprecated Config. creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling AutoPointer.c compiling AbstractMemory.c compiling Buffer.c compiling Struct.c Struct.c: In function ‘struct_set_pointer’: Struct.c:300:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=] memory->size, rb_obj_classname(self), layout->base.ffiType->size); ^ compiling MethodHandle.c compiling Variadic.c compiling MemoryPointer.c compiling Types.c compiling LastError.c compiling ClosurePool.c compiling Pointer.c compiling Call.c Call.c: In function ‘rbffi_CallFunction’: Call.c:301:9: warning: ‘rb_thread_blocking_region’ is deprecated (declared at /usr/include/ruby-2.1.0/ruby/intern.h:870) [-Wdeprecated-declarations] rb_thread_blocking_region(call_blocking_function, &bc, (void *) -1, NULL); ^ compiling Platform.c Platform.c:28:2: error: #error "Unknown cpu type"

error "Unknown cpu type"

^ In file included from /usr/include/ruby-2.1.0/ruby/ruby.h:1694:0, from /usr/include/ruby-2.1.0/ruby.h:33, from Platform.c:5: Platform.c: In function ‘rbffi_Platform_Init’: Platform.c:57:56: error: ‘CPU’ undeclared (first use in this function) rb_define_const(PlatformModule, "CPU", rb_str_new2(CPU)); ^ /usr/include/ruby-2.1.0/ruby/intern.h:786:27: note: in definition of macro ‘rb_str_new_cstr’ (__builtin_constant_p(str)) ? \ ^ Platform.c:57:44: note: in expansion of macro ‘rb_str_new2’ rb_define_const(PlatformModule, "CPU", rb_str_new2(CPU)); ^ Platform.c:57:56: note: each undeclared identifier is reported only once for each function it appears in rb_define_const(PlatformModule, "CPU", rb_str_new2(CPU)); ^ /usr/include/ruby-2.1.0/ruby/intern.h:786:27: note: in definition of macro ‘rb_str_new_cstr’ (__builtin_constant_p(str)) ? \ ^ Platform.c:57:44: note: in expansion of macro ‘rb_str_new2’ rb_define_const(PlatformModule, "CPU", rb_str_new2(CPU)); ^ Makefile:224: recipe for target 'Platform.o' failed make: *** [Platform.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/pi/.gem/ruby/2.1.0/gems/ffi-0.6.4 for inspection.

Some workaround to fix? I'd prefer to deal with rPi3 standard raspbian packages (eg ruby2.1 preferably)

xetum commented 7 years ago

SOLVED: I've replaced ...dependency(%q<ffi>, ["~> 0"]) by ...dependency(%q<ffi>, ["~> 1"]) in gemspec. Could you consider modifying it? Thanks

hexdigest commented 7 years ago

Hi @xetum Thanks for investigation! I'll update the gem in few minutes.

hexdigest commented 7 years ago

@xetum please update gem to version 1.5