Parallels / vagrant-parallels

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

Can not install vagrant-parallels #375

Closed ahoiroman closed 3 years ago

ahoiroman commented 3 years ago

Unfortunately I can not install the parallels-plugin for vagrant on macOS Big Sur. xCode is installed.

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/my-user/.vagrant.d/gems/2.6.6/gems/nokogiri-1.10.10/ext/nokogiri
/opt/vagrant/embedded/bin/ruby -I /opt/vagrant/embedded/lib/ruby/2.6.0 -r ./siteconf20201209-1259-owi79g.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/my-user/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.10/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/my-user/.vagrant.d/gems/2.6.6/gems/nokogiri-1.10.10 for inspection.
Results logged to /Users/my-user/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.10/gem_make.out
legal90 commented 3 years ago

Hi @ahoiroman,

Unfortunately, the errors of building nokogiri (the dependency gem which we have to use to work with XML documents) are not related to vagrant-parallels directly. Usually, the root cause is on macOS / "XCode Command Line Tools" side. Did you check the content of this file?

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

  /Users/my-user/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.10/mkmf.log`

Also, it could make sense to upgrage macOS to the latest patch version and re-install "XCode Command Line Tools".

ahoiroman commented 3 years ago

Hi @legal90

I am running latest macOS and reinstalled Xcode including CLI-Tools. The error is still present.

aske-cph commented 3 years ago

I am getting the exact same error on Big Sur - and also have Xcode installed properly.

Did you find a solution of this?

legal90 commented 3 years ago

@aske-cph Unfortunately, not. That's most likely related to the nokogiri gem - the 3rd party dependency which we use to parse XML documents.

Did you check the log file mentioned in the error message? (like /Users/my-user/.vagrant.d/gems/2.6.6/extensions/x86_64-darwin-19/2.6.0/nokogiri-1.10.10/mkmf.log or similar ). Can you show it please? (uploading to Gist would be good)

aske-cph commented 3 years ago

Thanks for the attention, but i just found a solution!

You have to reinstall command line tools: xcode-select --install

Then you can install without errors.

The error was:

https://gist.github.com/aske-cph/2a931bb11c11bc419c7b0d98e0af8d40

ahoiroman commented 3 years ago

Log shows

"clang -o conftest -I/opt/vagrant/embedded/include/ruby-2.6.0/x86_64-darwin19 -I/opt/vagrant/embedded/include/ruby-2.6.0/ruby/backward -I/opt/vagrant/embedded/include/ruby-2.6.0 -I. -I/opt/vagrant/embedded/include -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/vagrant/embedded/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/opt/vagrant/embedded/include -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fno-common -pipe conftest.c  -L. -L/opt/vagrant/embedded/lib -L/opt/vagrant/embedded/lib -L.  -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fstack-protector-strong -L/opt/vagrant/embedded/lib     -lruby.2.6   "
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from conftest.c:1:
In file included from /opt/vagrant/embedded/include/ruby-2.6.0/ruby.h:33:
In file included from /opt/vagrant/embedded/include/ruby-2.6.0/ruby/ruby.h:29:
/opt/vagrant/embedded/include/ruby-2.6.0/ruby/defines.h:123:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

reinstalling using xcode-select --install did solve the problem here, too.