Installing nokogiri with --use-system-libraries (was: Re: Migrating the guide to AsciiDoc)
Andrew Moore
slewsys at gmail.com
Tue Apr 24 07:21:15 UTC 2018
On Apr 23, 2018, at 6:23 PM, Rainer Müller <raimue at macports.org> wrote:
> $ sudo gem2.5 install nokogiri -- --use-system-libraries
> …
> pkg-config could not be used to find libxml-2.0
> …
> "pkg-config --exists libxml-2.0"
> dyld: Symbol not found: __cg_jpeg_resync_to_restart
> Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
> Expected in: /opt/local/lib/libJPEG.dylib
> in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
> package configuration for libxml-2.0 is not found
>
> This pkg-config command works fine outside of 'gem install’.
Okay, try installing the ruby gem pkg-config version 1.1:
$ sudo port select —set ruby ruby23
Selecting 'ruby23' for 'ruby' succeeded. 'ruby23' is now active.
$ sudo gem install nokogiri-1.8.2.gem -- --use-system-libraries
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR: Error installing nokogiri-1.8.2.gem:
ERROR: Failed to build gem native extension.
current directory: /opt/lib/ruby2.3/gems/2.3.0/gems/nokogiri-1.8.2/ext/nokogiri
/opt/bin/ruby2.3 -r ./siteconf20180424-30290-tretof.rb extconf.rb --use-system-libraries
…
$ sudo gem install pkg-config --version 1.1
Fetching: pkg-config-1.1.0.gem (100%)
Successfully installed pkg-config-1.1.0
Parsing documentation for pkg-config-1.1.0
Installing ri documentation for pkg-config-1.1.0
Done installing documentation for pkg-config after 0 seconds
1 gem installed
$ sudo gem install nokogiri-1.8.2.gem -- --use-system-libraries
Building native extensions with: '--use-system-libraries'
This could take a while...
Successfully installed nokogiri-1.8.2
Parsing documentation for nokogiri-1.8.2
Installing ri documentation for nokogiri-1.8.2
Done installing documentation for nokogiri after 23 seconds
1 gem installed
$
> The crash report in Console.log shows that the invocation of pkg-config
> included the environment variable: DYLD_LIBRARY_PATH=.:/opt/local/lib
Yes, I see that even after installing pkg-config gem, but nokogiri install proceeds nonetheless.
More information about the macports-dev
mailing list