-
-
Notifications
You must be signed in to change notification settings - Fork 899
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 1.8.4 installation challenges on macOS Mojave #1801
Comments
I was successful with But not with |
I'm sorry y'all are having trouble. If someone who is a Mac user would care to verify that this works and submit a PR to the installation tutorial, I would be very grateful. Alternatively, if there's something we can change in the extconf, I'd appreciate a PR. Also tagging @zenspider as he's been kind enough to offer assistance on behalf of Mac users in the past. |
I don't think the original report makes sense to me (reformatted):
This says "build and link against system libraries, but look for their configs in these completely different builds". I would expect that to break. See this for more details: http://www.nokogiri.org/tutorials/installing_nokogiri.html#using-your-system-libraries |
@zenspider I put one of many iterations made by me here. The problem is still same if I just You're right. There is a mistake in the command Only this worked
The expectation is I need only run |
OK. I found the reason why it's happening on Mojave See https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624 It's needed to make another step and install this as a temporary workaround on Mojave:
For explanation see the Xcode release notes |
@deepj Thank you for following up on the thread. Would you be so kind as to submit a PR to this file that includes steps other Mojave users can follow? I unfortunately don't have a Mac and so can't verify the steps that I might write up are correct. I'd really appreciate your help! |
@flavorjones I'll do. But what I got from the Xcode release notes, it's needed to change a way for looking headers on macOS 10.14 and later. Can @zenspider help here, please? I don't have no insight how these compilation stuffs work. |
I just hit this same problem on a machine upgraded to 10.14. |
Updating command line tools for Xcode fixed this for me. |
Again, an open request for Mac users to help support the Ruby community: Can someone please submit a PR to the installation tutorial explaining how to update xcode tooling on 10.14? |
This actually worked for on Mojav Mac OS X |
Once more, this time with gusto: can a Mac user on this issue please help support the Ruby community by submitting a PR to the installation tutorial explaining how to update xcode tooling on 10.14? |
@flavorjones the xcode command line tools is updated via app store. @wsizoo note seems to be confusing here. Just read the xcode release notes https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624 My understanding is that nokogiri needs to change a way where is looking for the headers on Mojave 10.14 with new xcode command line tools 10.x. As Apple noted in the release notes they offer a temporary workaround to install the headers to the old place. This won’t be possible later. Apple recommends to change the place where looking for the headers to new one. So updating xcode command line tools doesn’t help either. That is my understanding the situation. I may be wrong here: |
I managed to install it on 10.14 by running:
Followed by:
Happy to submit a doc update PR if this solution appears to help others. |
@grega the problem with this, it won't work in the future. It's just a temporary workaround offered by Apple. Just read this https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624 |
Ok, I better understand the underlying challenge, which is to look for header files and libraries in the right place with the new XCode SDK. Thanks for that. This is still not something I'm personally equipped to handle, so I'd like to ask that someone who cares about Mac support help me either by submitting a PR or working with me to figure out what an appropriate solution looks like. I don't own a Mac, and and in addition this is something I'd expect someone from the community can help with or own entirely. |
OK, maybe if I provide a bit more information on how I'd address this if I had access to a Mac running Mojave, somebody can verify that the approach would work.
if darwin?
ENV['CFLAGS'] = "#{ENV['CFLAGS']} -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
end Is anyone here able to try patching their |
I was able to install Nokogiri on Mojave after running only |
For people using homebrew the documentation around macOS and homebrew install helped me figure out the command bellow which worked for me:
|
Hey all, I my comments above I suggested a potential fix, provided a patch, and asked if any macOS users would try it out and let me know if it resolves the underlying issues. This comment is asking one last time if anyone in Ruby community who's a macOS user can try this three-line change out on their local machine and let me know if it addresses the underlying issue. If somebody can try it out and respond, I'll provide an emphatic "thank you" in the changelog for your help. If nobody responds, I'm going to assume it's no longer an issue. |
@flavorjones Afraid I haven't had any luck getting my Mac back to a state in which Nokogiri was failing to install, so I have been unable to test the suggested fix in |
Hey @flavorjones, I want to let you know that 1.8.5 installs automatically in Mojave computers with the latest updates and without needing to do any changes to nokogiri (or your suggested change to extconf.rb) |
@bbonamin you're probably talking about a clean install where there was no nokogiri in the past. I think half the people come here because it breaks after os or brew upgrade. Definitely was the case for me. After bashing my head against it for a few hours it turned out that I had a stale libxml path in bundle config. I ended up using |
I am so happy this solved my problem I've been trying to fix this for the past few days. Y'all need to fix these installation issues. |
@kenkuts Did you happen to read any of my comments above where I'm trying to get someone to confirm that a one-line change in Once again: any Mac users arriving at this issue, STOP trying to hack it. Read this comment above: Please clone the repository, make this small change to extconf.rb, run I'm about to cut v1.9.0 and to date nobody who is using a Mac has been able to tell me if that fix works, and so it's not going to be in this release. It won't be in a release until someone can confirm that it works. Snarky comments will not get the job done; testing a suggested fix will. |
@flavorjones OK, I figured out why this happens to someone of us. Someone of us has something like I've tried the patch. And that didn't help at all. |
In my case, the problem was more related to https://stackoverflow.com/questions/14607193/installing-gem-or-updating-rubygems-fails-with-permissions-error Basically, when I run the Once I make sure that after run |
Updating to the latest version of Nokogiri 1.9.0 solved the problem for me
|
Hey @flavorjones , this seems to work for me (I used Edit: Nokogiri 1.9.1 now works for me when I install it from a Gemfile and use |
@rajivshah3 thank you. That last one is bundler... And I thought it was fixed. I haven't seen it for a little while. You might want to update. |
This worked for me. Tried almost all the suggestions available on google, stackoverflow, github but failed. This is like life saver for me. |
@deepj Thanks for your reply -- there's a lot of noise in this thread and you're providing some clarity. Can you provide your |
@flavorjones Hello, I'll look at it this weekend and then I let you know. I'm sorry for the late answer, holidays here. |
Please note that @mlj confirmed that the fix suggested in #1801 (comment) works for him, and has submitted the PR in #1851 |
I've merged #1851 into master. I'm considering cutting a v1.10.1 release with this change. Will leave this open until a version is shipped. |
@Onkar09 Could you please provide more context?
|
@flavorjones I think most of the “solutions” mentioned above are already covered in the documentation; others just cannot reproduce, so we can close this issue.
Ok I read that macOS Mojave is not adding |
@FranklinYu A fix has already been commited to master - please see my comment above. |
I had the error for a specific version 1.6.6.2 this solved for me -> |
@akshatpaul If I were maintaining Nokogiri I won’t provide any support for a release more than 4 years ago. Note that 1.6.6.2 was released on January 23, 2015. Please don’t spam this issue since you’re pretty much on your own. |
@akshatpaul perhaps a kinder way to phrase @FranklinYu's reply is that Mojave was release on September 24, 2018, which is nearly two years after Nokogiri v1.7.0 superseded v1.6.x, and so it's not supported on Mojave (although some of the hints here might help make it work). Thanks for using Nokogiri, and sorry I can't be of more help right now. |
If you're having trouble installing Nokogiri ...
Have you tried following [the installation tutorial][tutorial]?
yes
What is the output of
gem install
?What are the contents of the
mkmf.log
file?What operating system are you using?
macOS 10.14 Mojave
I've tried to reinstall everything what I could but without any success. I used
pkg-config
,libxml2
andlibxslt
from Homebrew...The text was updated successfully, but these errors were encountered: