-
-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nokogiri install fails on mac because homebrew libxml is too new #1166
Comments
This workaround allowed me to get the current nokogiri at least installed.
Not sure why this directory wasn't consulted beforehand? Seems to work for now. However the instructions at https://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 still are faulty and don't give you / me a working nokogiri. |
try this:
you shouldn't have libiconv and friends linked into /usr/local/include and brew explicitly warns you about that:
you also shouldn't be doing --use-system-libraries, nokogiri wants very specific libraries that its is packaged with. and if you have Mac 10.9 and have a correctly working installation of xcode you should be able to simply 'gem install nokogiri' now. |
I have to say I'm not quite sure what you're suggesting, here's the output from the brew unlinks:
None of those libraries where linked. I did try to use them with the explicit build settings as described at https://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 and that didn't work with the error I reported initially. So my bug report still stands, the instructions provided at https://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 for homebrew do not work and should be fixed as the installed version of libxml2 seems to be too new. |
Looking deeper into this issue I just realized that I already reported the root cause of this problem earlier #1119 and forgot about it... |
So your title suggests "because homebrew libxml is too new" Not linking against homebrew's libxml2/libxslt/libiconv will solve the problem. Nokogiri comes packaged with libxml2 and libxslt, and the libiconv in /usr/{lib,include} on 10.9 works fine. So don't use --use-system-libraries, don't use any of the --with-XXX options and don't set NOKOGIRI_USE_SYSTEM_LIBRARIES=1 That does work. If it does not work then either your Xcode install on your Mac is broken (mine was broken and /usr/include/iconv.h was entirely missing for some unknown reason related possibly to O/S upgrades, reinstall and restores from time machine over the years), or else nokogiri is finding your homebrew libraries linked up (which is sounds like it isn't) or is finding other libxml2/libxslt/libconv libraries from MacPorts or other installs that you have on your system that aren't the base O/S. On a blank Mac 10.9 box with xcode freshly installed, even with homebrew installed properly without the libs being linked up then 'gem install nokogiri' with no options should work. |
Thanks for taking the time to reply. I'd like to tackle your suggestions one by one. First for the suggestion not to use --system-libraries: The problem here is that the version of libxml2 that is packaged with nokogiri does not find some of the lzma library, as documented in #1119 - so sadly that is not an option. Looking at that specific error it seems that it is searching for those symbols in the packaged libxml2 instead of in some system library, which is why I suggested the problem might be with nokogiris packaged library instead of the system - but of course that might be because my C is a bit rusty. I would love to get a reply from you there though (or here, but about that topic). Second:
Which to my understanding uses Third: I would like you to take notice that the instructions presented at https://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 do not work anymore and need adjusting. |
I've got the same Mac O/S version that you do, I've got homebrew and an identical (on paper) setup, and 'gem install nokogiri' works fine. Whatever is going on in #1119 there is another fix that does not involve using any flags to nokogiri. |
I am running into the same issue and I have spend literally an entire day trying to resolve it. I hate configuration hell! |
@EvanTedesco: I'd like to add that it turned out in the end that some homebrew libraries that I had installed and that got linked for some reason I can't fathom but shouldn't turned out to cause this for me. So you should probably try deactivating / removing homebrew and see if that solves the problem for you too - then find out which linked homebrew libraries are the problem for you (aren't that many candidates). |
I believe we've captured a working installation procedure in the updated tutorial here: If I'm mistaken, please let me know what I'm missing and I'll reopen. |
@dwt you're a genius, I had the exact same issue as your original issue, and will be closing the issue I recently reported on jekyll-help |
Yes thanks @dwt - I was having the same issue on Mac OS 10.8.5 and tried a bunch of different things, but the only thing that finally worked was your suggestion:
So thank you! |
I'm not a coder, so I have to rely on recipes such as this. The command-line formula that @dwt specifies worked for me using OS X 10.11.1 (El Capitan). |
@dwt suggestion also helped me running Mac OS 10.9.5, RVM 1.26.11, Homebrew 0.9.5. Thank you!! |
@maintainers: Hey guys, since this problem is really old and recurring and the workaround I posted is really not the right solution. What about building in some better error checking into the formula so it can better deal with the underlying cause of this issue? I mean, for every user who comes here, there are probably a thousand who have this problem, so it would be really worth it. |
Running: |
The error is
|
got the same problem here with archlinux. doing |
(El Captain) I resolved the issue by: |
Hi all, I'll again encourage everyone to please please please take a look at the installation tutorial and give us feedback if it doesn't contain correct information, preferably by opening an issue either here or at https://github.com/sparklemotion/nokogiri.org-tutorials I'm going to lock this issue down to disincentivize people from continuing to post here. It's in everyone's interests to invest in improving the documentation; so please help us help future developers. |
Hi there,
following the instructions on https://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 doesn't seem to work anymore.
Following it I get this output:
As far as I can tell the homebrew version of libxml is deemed too new, while the system version is deemed too old.
Perhaps a nokogiri update is advised?
Installed versions of libraries:
What is the recommended way to install nokogiri in this environment?
The text was updated successfully, but these errors were encountered: