AndrewDryga / vagrant-box-osx

Issue tracker for macOS Sierra Vagrant box.
https://app.vagrantup.com/AndrewDryga/boxes/vagrant-box-osx
MIT License
983 stars 106 forks source link

Xcode Command Line Tools issue in Yosemite box #23

Closed stopiccot closed 8 years ago

stopiccot commented 9 years ago

Hi, I'm using Yosemite box for some iOS app testing. We are configuring test server environment on testing machine. Running bundle install for our rails app fails with such output:

Installing nokogiri 1.6.6.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/vagrant/.rvm/rubies/ruby-2.0.0-p645/bin/ruby -r ./siteconf20150616-20505-x5w77i.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions.  If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----

Running xcode-select --install and accepting installation in UI messagebox solves problem. Mavericks box doesn't have such problem.

Can you please fix this cause thanks to Apple installing command lines tool requires user interaction and can not be full automated.

AndrewDryga commented 9 years ago

Actually it's possible, try this one: sudo xcodebuild -license accept. Right now I don't plan to re-package Mavericks box. Why do you prefer it?

phikes commented 9 years ago

I see the exact same problem as @stopiccot. Also running the command you recommended, @AndrewDryga (and even running xcode-select --install afterwards) does not resolve that issue for me.

phikes commented 9 years ago

I was able to install nokogiri by running:

sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 --use-system-libraries

This solution came from here.