-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
Compile issue on OS X Mavericks 10.9.5 #1206
Comments
I have a similar issue in 10.10.1 and created a gist with the necessary information. I already tried entirely removing and re-installing the ruby. |
I have a similar issue. However for me, the mysterious directory is The full error log is here: https://gist.github.com/behrangsa/d95a9e6e48d718fd6b94 In short, here are the list of errors:
System DetailsOS: Mavericks 10.9.5 |
For me, setting the
|
the warning with |
@mpapis, I realized that, but it still doesn't seem correct for the gem to expect to find something in |
@behrangsa its limitation of remembering compilation flags by ruby, when the binary rubies are compiled by me or on travis they require to be given paths to statically linked libraries ( |
@mpapis, I didn't know that. If this is something common to gems with native extensions, etc. and how MRI works and it is harmless, then I have no complaints. 😃 |
it is standard and harmless thing, but ruby could allow filtering out this flags, this could be done as part of the filtration process that already happens in preprocessing in miniruby - but I do not think it would be considered as a ticket without pull request / patch to address this problem. |
But the nokogiri install insists on displaying scary warnings against doing this
I'm beginning to suspect that the error I'm wrestling with
is one of those compatibility problems |
It's not clear to me that there's anything actionable in this issue. Please let me know in the next few days if something is still broken or you're still unhappy; otherwise I'll close after 2015-03-05. |
The issue is very much alive, tl;dr: Can't build Nokogiri 1.6.6 on a modern OSX (10.9 or 10.10). |
+1 same issue as described by @cabo here |
ok was able to fix it by running
|
I think I ran into the same problem as ArloL. In my case I suspect that it has something to do with my MacPorts iconv (in /opt/local/lib) vs. the system iconv (in /usr/lib). I get the feeling libxml2 is being linked against iconv from /opt/local/lib whereas libxslt is trying to pull in the system iconv from /usr/lib. I can't see why that would be, but in any case I was able to get Nokogiri 1.6.6.2 built with its bundled libxml2 and libxslt with
Using Nokogiri's I'm running Ruby 2.2.1 via rbenv, OS X 10.9.5. |
@felipecsl - The fix you point out is documented at http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x @cabo - Does this fix work for you? If not, have you followed advice documented at http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x ? @dsedivec - Have you followed advice documented at http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x ? I apologize for asking this question multiple times, but if the docs are incomplete or don't work for you, that's EXTREMELY valuable information; and it's not clear from this thread who's aware of (and following) the advice that @zenspider has taken the time to document there. Unless I hear back from someone on this thread that the documentation is being followed and does not address your situation, I intend to close this issue later this week. |
I think so? Let me address each point in that document:
I'm not using Homebrew.
I'm not on Yosemite, I'm on Mavericks.
I don't, like @ArloL I get:
However, as I said in my previous comment, I think the problem really was with iconv. Nonetheless, I did run
I don't really know what compiler was used for Ruby, but I prefer to believe it was what I get when I type
That is the latest, to the best of my knowledge.
I don't think mine is? I guess I don't know how to check.
I think they are? I'm compiling Ruby and Nokogiri back-to-back on the same OS X system.
I believe I only have one version of Xcode installed. |
Thanks @dsedivec for the solution :) I also had the error conftest.c:7:23: error: too few arguments to function call, single argument 'cur' was not specified and LDFLAGS=-L/opt/local/lib gem install nokogiri -v '1.6.6.2' worked :) |
Yes. The specific problem is that the test is broken.
That makes extconf think that there is no libxml2. This bug is somewhat masked by the many ways in which prerequisites can be broken, so there are indeed other ways to get similar errors. But you still need to fix this particular bug. In extconf.rb, you need to call have_func with the necessary arguments for xmlParseDoc(). |
I'll offer my experience since I was just struggling with this as well. I was investigating the error "conftest.c:15:27: error: too few arguments..." as well and I discovered that even if I fixed it to compile successfully, it would fail to link because the locally built libxml2 library was compiled for the wrong arch. That lead me to suspect that the wrong compiler was being used for those libraries. (I use macports, not homebrew, so I had ignored the instructions about homebrew which mention perhaps needing to uninstall gcc.) In anycase, I dropped macports' bin directory from my path and tried again, and finally it installed cleanly. So, perhaps a note warning macport users as well that gcc might be picked up is worthwhile. (Or even better would be if the install script could somehow warn that the wrong compiler was being picked up when building xml2. Could potentially avoid a lot of confusion.) |
Got this error message when running
on OSX Yosemite. I use MacPorts. I used the fix in @felipecsl 's post to install nokogiri, then the rest of the rails installation succeeded for me. |
Just had another course of 21 students run into this issue. Increasing the robustness of this installation process should be very, very, very high on the priorities of this project. |
Summoning @zenspider for assistance. |
@cabo a claim of 21 datapoints w/ no data is just as bad as a claim of 1 datapoint with no data. It's just 21x sadder. I can't act on anything if I don't have details to reproduce the issue. As you can see here, nokogiri installs fine for my setup, so there's little I can do for you w/o more info: http://www.zenspider.com/~ryan/nokogiri.mov I forgot to include this in the video:
@flavorjones I'm seriously tempted to suggest you lock this issue down so we get more people filing new (hopefully useful) bugs rather than "me too" votes. ETA: sorry. I thought this was the OTHER (other other) "Can't build on osx" ticket. I haven't seen this one yet. I withdraw my request to lock until I've reviewed the data (if any) provided. |
@pgm if you've diagnosed and fixed this while using macports, do you think you can send me a PR against the doco with tips on how to deal with it? |
@cabo I'm getting the impression that you're not interested in contributing towards this ticket. 3 comments in 24 hours with zero data to help further the cause. Can you please either contribute data from your 21 students that might help us diagnose this problem or refrain from diluting the signal? |
@jcayzac can you tell me what |
@zenspider The data I do have is much earlier in this thread. I don't have new data from the course I'm running right now because people quickly resorted to the (somewhat questionable) workarounds documented over the last couple of years in a number of places, such as, http://stackoverflow.com/questions/19643153/error-to-install-nokogiri-on-osx-10-9-maverick |
One data point from the laptop of a student that had trouble installing:
This is just one data point, but the plot thickens around Macports. |
@zenspider hmm never mind, I'm getting different results now: the linker flags have the right $ type pkg-config
pkg-config is hashed (/opt/local/bin/pkg-config)
$ port installed libxml2
The following ports are currently installed:
libxml2 @2.9.2_2+universal (active)
$ pkg-config --libs libxml2
Package libxml2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml2' found
$ pkg-config --libs libxml-2.0
-L/opt/local/lib -lxml2 Note I'm on Yosemite, so this might not be relevant to the issue the OP reported. |
@jcayzac good point. From the laptop of the student:
|
Hi all, It's still not clear to me how we can reproduce this issue. If the nokogiri core team can reproduce it, I promise we'll fix it, but based on my reading of the above thread, @zenspider is stymied. @cabo - Some of your above info indicates that this might correlate with macports. Has anyone confirmed that? Has anyone seen this problem when not using macports? I'd also like to caution everyone on this thread to check the loaded language. Let's be constructive with each other and work towards reproducing the issue and finding a solution. |
I have seen this failure while using Homebrew (see my report above), but it was a long time ago and I've upgraded everything. I have tried, several times, to reproduce it with current everything, and I have not been able. |
@flavorjones maybe that's the wrong question. Given that the test appears to be wrong, we're curious why it still goes through in many cases. But maybe that's not so important; you could fix the test anyway and that might solve it for all if us? |
Ah. If I fix the xmlParseDoc test, I then run into the libiconv problem. One aggravating circumstance of this cluster of problems is that, from the command line, you cannot see which of the several problems you've run into; you really have to examine the mkmf.log. I'll continue to investigate this until I get it running with macports installed ahead of homebrew. Just as an indication of progress, here is the first fixlet for extconf.rb:
|
@flavorjones I'm indeed focusing on the situation with MacPorts installed, specifically with the MacPorts bin directory ahead of the HomeBrew bin directory in ENV['PATH']. I'm running into a bit of a problem with the libiconv selection, which stops me from fixing the rest of the installation tests (have_func): I don't know how to make the tests select the same libiconv that MiniPortile selects for the libxml2/libxslt builds. So the libxml2 tests currently always fail on missing symbols from libiconv. The workaround from @dsedivec (set LDFLAGS=-L/opt/local/lib in the environment) does not help me here, as the installation tests still use -liconv, without any reference to /opt/local/lib, and that seems to point to /usr/lib. |
Hi all, glad I found this thread and that is still being extended at this late date. This issue appeared for me suddenly yesterday. Heretofore, I have happily compiled Nokogiri 1.6.x in the usual way with Bundler numerous times. I can show I last successfully compiled 1.6.6.2 into a Rails 4.2/Ruby 2.1.5 app on 2015-07-15, and that was the last time, until yesterday, I had attempted to do so. FWIW, Nokogiri 1.6.3.1 continues to install successfully in a Rails 3.2/Ruby 1.9.3 app. I also use MacPorts. I do not know what changed. Possibly Xcode 6.2, but I don't remember when that update dropped and whether it was after my last known successful build in July. RVM is a recent update, but the ruby 2.1.5 was built 2014-12-22. Here's my environment rundown:
I looked at the advice documented at http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x, however that is not applicable; I don't use HomeBrew, I'm not on Yosemite, I don't have errors about libiconv. The particular error I have is as follows:
Which is the same as reported earlier in the thread. Looking in mkmf.log, in the section labeled There is this:
In the next invocation, this:
The same errors are reported in the section Trying Trying Nokogiri 1.6.5 produced the same result. I do not have libxml2 installed using MacPorts
The workaround from @dsedivec I'll check with a co-worker who has a similar configuration but on Yosemite tomorrow to see if she can continue to build Nokogiri. Thank you all for continuing to look into this and for all your help. |
@rbbicknell Do you have an easy way to find out what you installed into MacPorts since July? (e.g., feeding an appropriate prefix of ls -tr of /opt/local/bin into |
I can safely say I haven't port installed anything lately. The last thing I installed was git +svn on 2014-12-29. I do run
I think I recall that I had to tell RVM to build ruby 2 using a MacPorts compiler on a Yosemite box, but I don't have those notes here. I don't have any notes about doing anything unusual when I built Ruby on this box. |
I hope I am not just being a "me too". I ran into this same issue, but I don't use MacPorts, so I thought it worth mentioning. I was trying to install on OS X 10.10.5 using the built-in ruby and XCode 7. I do have homebrew installed.
I could see in the successful install (.mov) from @zenspider, he was using ruby 2.2, so I installed rbenv using the instructions from here. After that, I was able to get through the installation without error. So maybe the trick to reproducing this issue is to not use rbenv or rvm. |
@dlech Be careful with the "same issue" -- there are a number of issues that manifest themselves in the same symptom. Can you pastebin the mkmf.log from the failed attempt? |
@dlech The include files from the newly built libxml2 are not found by the rest of Nokogiri's build process. Looking at the log, I'm wondering what |
I am using Homebrew and having this issue on OS X 10.11. Here is the output of the build failure: I am running the command:
Here is the output in mkmf.log:
|
I had the same symptoms as @dlech, but different mkmf.log (See above). Here is my ruby and clang before trying @dlech 's fix:
Installing rbenv and installed 2.2.2, but did NOT switch to 2.2.2. This fixed the compile issue with nokogiri. Maybe there is a missing dependency that gets installed from rbenv? |
@tmichaelrogers "I tried everything here" mmmm, I have doubts about that. You're using osx 10.11, stock ruby, and homebrew. Me too. It works out of the box for me:
Please try the same command and get back to me. |
@zenspider Mocking me? Honestly?!? And the "it works on my machine" response? I really appreciate the work people put into sharing their software with others, but you need to learn to treat people with respect who are trying to help improve your product. I need this for a new system I have inheirited. The first thing I am going to do is get rid of the dependency on your project. I ran that command and here is my output. I hope it helps you track down an issue.
But as I said already, I was able to get it installed using Bundler after I installed rbenv. So my problem is fixed. Try not to be such a pompous ass. |
I was trying to figure out if bundler is the main variable causing this problem. Using the same OS version, the same stock ruby, both having homebrew, but only one using bundler made that possible. That's it. That's your whole conspiracy behind my "worked for me" response. The experiment is tainted by rbenv being thrown into the middle and I'm not sure how I'm going to isolate that, but that's an issue that I'll work out with someone else and while I'm not on my birthday vacation. For the record, I don't even have (or want) commit bit on this project. I simply help out @flavorjones debug osx build issues because he doesn't primarily use osx. Mocking you? Disrespecting you? Pompous ass? Grow a professional backbone and go back and read my comment again. I didn't mock you and I don't need or deserve your abusive bullshit. To quote @flavorjones:
@flavorjones Please lock this ticket down. I'm absolutely done with it. If more issues come up, then new issues can be filed. |
Before this ticket gets locked down, let's summarize what we know so far: |
Macports is a separate issue and really needs a separate issue filed. |
Hey, everybody. Holy cow. Look, I get that it's frustrating when Nokogiri won't install. Lots of things about this thread are frustrating, including its length, the relative irreproducibility of the issue, and presence of a couple of "me toos". None of those frustrations justify the lack of empathy I'm seeing on this thread. So, this ticket has been open for quite a while, and I actually think that at least some of the problems described on this thread will be solved when we ship the fix described at #1345 and #1218. I'm going to close and lock this conversation, because I don't see any meaningful progress on reproducing the issue in the last month or so, and because of the unproductive conversations and noise. @cabo - Thanks so much for sticking with this issue. Can you please reach out to me directly via email and we can continue working on this? I still don't believe I understand what's going on, but it's software, and so if we can reproduce it we can fix it. |
Despite saying that it's using a special bundled libxml2, the process fails to find it. Here is the interesting excerpt from
~/.rvm/gems/ruby-2.1.2@my_service/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/mkmf.log
. Suspicious lines (there is no "travis" user on my system):The text was updated successfully, but these errors were encountered: