Ruby: Installing Native Gems With Custom Library
mouse 2006 · person cloud · link
Last update
2016-12-07
2016
12-07
«maledetto libxml2 che cambia i prototipi delle funzioni...»

Copiare le librerie in un path alternativo:

  1. scaricare i deb ed estrarre le librerie da:
    https://packages.debian.org/wheezy/libxml2 e
    https://packages.debian.org/wheezy/libxml2-dev
  2. copiare include e lib in /opt
  3. gem install libxml-ruby -v 2.3.3 ora funziona perchè cerca in /opt, /usr/local, /usr

Tramite bundle config (non mi funziona):

  • Da sourcebender: gem install toland-patron -v "0.4.1" -- --with-ldflags="-Wl,-R/opt/curl/lib"
    The key part is the –with-ldflags option at the very end. The -Wl,-R option adds the given path to the list of paths the linker will use to find libraries at runtime.

  • Da stackoverflow: gem install libxml-ruby -- --with-xml2-dir=/path/to/libxml2 --with-xml2-lib=/path/to/libxml2/lib --with-xml2-include=/path/to/libxml2

  • Da Tomaso:
    ARCHFLAGS="-arch x86_64" RC_ARCHS=x86_64 gem install libxml-ruby --verbose -v 2.3.3 -- --use-system-libraries --with-xml2-include=/opt/mylibs/include/libxml2/libxml --with-xml2-lib=/opt/mylibs/lib/x86_64-linux-gnu

    ARCHFLAGS="-arch x86_64" RC_ARCHS=x86_64 gem install nokogiri --verbose -v '1.6.8.1' -- --use-system-libraries --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib

    ARCHFLAGS="-arch x86_64" gem install pg -v '0.19' -- --with-pg-config=/opt/local/lib/postgresql95/bin/pg_config