Parallels / vagrant-parallels

Vagrant Parallels Provider
https://parallels.github.io/vagrant-parallels
MIT License
996 stars 87 forks source link

Solution to Error when installing on macOS 11 Beta 1 #358

Closed mikebronner closed 4 years ago

mikebronner commented 4 years ago

Hi, I wanted to share the solution to the following error on macOS 11 Beta 1 when running vagrant plugin install vagrant-parallels:

Installing the 'vagrant-parallels' plugin. This can take a few minutes...
Building native extensions. This could take a while...

Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

ERROR: Failed to build gem native extension.

    current directory: /Users/mike/.vagrant.d/gems/2.6.6/gems/nokogiri-1.10.9/ext/nokogiri
/opt/vagrant/embedded/bin/ruby -I /opt/vagrant/embedded/lib/ruby/2.6.0 -r ./siteconf20200623-2170-zi3tgs.rb extconf.rb
checking if the C compiler accepts -I/opt/vagrant/embedded/include -I/opt/vagrant/embedded/include/libxml2 -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
    --help
    --clean
/opt/vagrant/embedded/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /opt/vagrant/embedded/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
    from /opt/vagrant/embedded/lib/ruby/2.6.0/mkmf.rb:532:in `with_werror'
    from /opt/vagrant/embedded/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
    from extconf.rb:138:in `nokogiri_try_compile'
    from extconf.rb:162:in `block in add_cflags'
    from /opt/vagrant/embedded/lib/ruby/2.6.0/mkmf.rb:643:in `with_cflags'
    from extconf.rb:161:in `add_cflags'
    from extconf.rb:416:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/mike/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.9/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/mike/.vagrant.d/gems/2.6.6/gems/nokogiri-1.10.9 for inspection.
Results logged to /Users/mike/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.9/gem_make.out

The solution is to manually download The Xcode Command Line Tools Beta from the Apple Developer site.

carcus88 commented 4 years ago

This looks like a similar issue to an ongoing issue I'm having with 10.15.5 that should have been resolved but does not appear to be.

https://github.com/Parallels/vagrant-parallels/issues/348#issuecomment-642155079

My solution was to downgrade vagrant to 2.2.6-dev from https://github.com/hashicorp/vagrant-installers/releases/tag/v2.2.6%2Bbuild-updates. Curious if that works for you as well @mikebronner ?

mikebronner commented 4 years ago

@carcus88 The error was solved by installing Xcode Command Line Tools for me. :)