2016-11-13 1 views
1

Ich versuche einige Ruby-Skripte auf meiner Synology DiskStation DS216j auszuführen. Ich schaffte es erfolgreich Rubin 2.3.1 über OPKG/Entware-ng zu installieren, aber wenn ich versuche, Edelsteine ​​mit nativen Erweiterungen zu installieren, erhalte ich eine Fehlermeldung:Der Versuch, Ruby-Edelsteine ​​auf der Synology DiskStation DS216j zu installieren, kann keine Ruby-Header-Dateien finden.

$ sudo gem install io-console 

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

    current directory: /volume1/@entware-ng/opt/lib/ruby/gems/2.3/gems/io-console-0.4.6 
/opt/bin/ruby -r ./siteconf20161113-31591-ucvjgl.rb extconf.rb 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/opt/bin/$(RUBY_BASE_NAME) 
/opt/lib/ruby/2.3/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /opt/lib/ruby/2.3/mkmf.rb:571:in `block in try_compile' 
    from /opt/lib/ruby/2.3/mkmf.rb:524:in `with_werror' 
    from /opt/lib/ruby/2.3/mkmf.rb:571:in `try_compile' 
    from /opt/lib/ruby/2.3/mkmf.rb:835:in `macro_defined?' 
    from extconf.rb:7:in `<main>' 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /opt/lib/ruby/gems/2.3/extensions/arm-linux/2.3/io-console-0.4.6/mkmf.log 

extconf failed, exit code 1 

Gem files will remain installed in /opt/lib/ruby/gems/2.3/gems/io-console-0.4.6 for inspection. 
Results logged to /opt/lib/ruby/gems/2.3/extensions/arm-linux/2.3/io-console-0.4.6/gem_make.out 

Der Inhalt /opt/lib/ruby/gems/2.3/extensions/arm-linux/2.3/io-console-0.4.6/mkmf.log:

"arm-openwrt-linux-gnueabi-gcc -o conftest -I/opt/include/ruby-2.3/arm-linux-gnu -I/opt/include/ruby-2.3/ruby/backward -I/opt/include/ruby-2.3 -I. -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/include -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/include -I/media/ware3/Entware-ng.2016.08/staging_dir/toolchain-arm_cortex-a9_gcc-5.4.0_glibc-2.23_eabi/usr/include -I/media/ware3/Entware-ng.2016.08/staging_dir/toolchain-arm_cortex-a9_gcc-5.4.0_glibc-2.23_eabi/include -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/include -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/include -D_FILE_OFFSET_BITS=64 -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/include -I/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/include -fPIC conftest.c -L. -L/opt/lib -L. -L/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -L/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/media/ware3/Entware-ng.2016.08/staging_dir/toolchain-arm_cortex-a9_gcc-5.4.0_glibc-2.23_eabi/usr/lib -L/media/ware3/Entware-ng.2016.08/staging_dir/toolchain-arm_cortex-a9_gcc-5.4.0_glibc-2.23_eabi/lib -L/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/lib -Wl,-rpath-link=/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/lib -L/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/lib -Wl,-rpath-link=/media/ware3/Entware-ng.2016.08/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/lib -L/media/ware3/Entware-ng.2016.08/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/ruby-2.3.1 -fstack-protector -rdynamic -Wl,-export-dynamic  -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" 
/opt/bin/ld: cannot find -lruby 
collect2: error: ld returned 1 exit status 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main(int argc, char **argv) 
4: { 
5: return 0; 
6: } 
/* end */ 

/opt/bin/ld: cannot find -lruby scheint zu sein, der wahre Fehler hier.

googeln dies führt zu Empfehlungen des Ruby-Quellcode/Header installieren which I did:

$ wget -qO- http://pkg.entware.net/binaries/armv7/include/include.tar.gz | tar xvz -C /opt/include 

[snip] 

$ ls -lah /opt/include/ruby-2.3/ 

drwxr-xr-x 4 1000  1000  4.0K Aug 19 12:42 . 
drwxr-xr-x 179 root  root  20.0K Oct 10 09:32 .. 
drwxr-xr-x 3 1000  1000  4.0K Aug 19 12:42 arm-linux-gnu 
drwxr-xr-x 3 1000  1000  4.0K Aug 19 12:42 ruby 
-rw-r--r-- 1 1000  1000   868 Jul 11 2012 ruby.h 

Also ich denke, die wirkliche Frage ist: Wie kann ich /opt/bin/ld sagen, dass die Ruby-Header-Dateien in /opt/include/ruby-2.3/ befinden?

Jede Hilfe oder Tipps sind willkommen, danke!

Antwort

1

/opt/bin/ld: cannot find -lruby bedeutet, dass der Linker die Bibliothek Rubin finden, nicht die Header. Sie benötigen die kompilierte gemeinsame Objektbibliothek unter /opt/lib/libruby.so oder statische Bibliothek .

+0

Halleluja !! Es funktionierte! Ich hatte '/ opt/lib/libruby.so.2.3.0', also symbolte ich es mit'/opt/lib/libruby.so' und dann konnte ich den Edelstein erfolgreich installieren! Vielen Dank!! :) –

Verwandte Themen