On Apr 23, 2018, at 6:23 PM, Rainer Müller <rai...@macports.org> wrote: > > On 2018-04-23 20:35, Andrew Moore wrote: >> You might try: >> >> $ sudo gem update —system >> >> which should install the latest version of bundler (you really want that), >> and go from there. >> In the particular case of nokogiri, you might also try running `gem install >> nokogiri` as user root. > > I am very cautious about running third-party package managers as root > and let them write to ${prefix}. That is supposed to be managed by > MacPorts and no other package manager should update files. > > If this overwrites any file provided by the ruby port, just running > a deactivate/activate cycle will bring back the old version. Or an > inconsistent state, if it also wrote new files to keep the version > information. > > If there is ever going to be a rb23-nokogiri port, I expect this to > cause conflicts later with files not known to MacPorts. > > When I uninstall the ruby port, this might leave traces behind > in ${prefix} that can be cleaned up, but I would not be aware of that. > > nokogiri uses vendored versions of zlib/libxml2/libxslt and other > dependencies by default. I already have them installed in ${prefix} > and I do not want to build them again from source, therefore I used > --use-system-libraries (as the README of docbookrx suggested). > > I even dared to give this a try as root (again, not recommended), > but this also fails in the same way: > > $ sudo gem2.5 install nokogiri -- --use-system-libraries > ... > pkg-config could not be used to find libxml-2.0 > ... > > From .../mkmf.log: > > "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'. > > The crash report in Console.log shows that the invocation of pkg-config > included the environment variable: DYLD_LIBRARY_PATH=.:/opt/local/lib
I do remember having to run as root user to get nokogiri to install at one time. In particular, running as `sudo` was insufficient. I’m guessing that it was a sandboxing issue, but don’t recall the details, nor even the version of ruby involved. That shouldn’t be necessary today, though Nokogiri has been problematic to install at times over the years. I'll start right now trying to hunt the problem down, with a vanilla Install of MacPorts on a macOS 10.12 system and MacPorts ruby 2.3. I’ll just mention while on topic that ruby is developed on Linux, so macOS support can lag. For instance, the current version of ruby-ffi works fine on *BSD, but not macOS, where I have to go back to an earlier version (1.9.21). -AM