"vagrant plugin install vagrant-parallels" fails!

Discussion in 'Parallels Provider for Vagrant' started by tombensve, Apr 15, 2018.

Tags:
  1. tombensve

    tombensve Bit poster

    Messages:
    9
    Below is the output of my try to install vagrant-parallels.

    Do note that I have a very clean install (reformatted system disk) of High Sierra. I ran Sierra or lower the last time I did this.
    ___________________________________________________________

    Tommys-iMac:~ tommy$ vagrant plugin install vagrant-parallels
    Installing the 'vagrant-parallels' plugin. This can take a few minutes...
    Fetching: mini_portile2-2.3.0.gem (100%)
    Fetching: nokogiri-1.8.2.gem (100%)
    Building native extensions. This could take a while...
    Bundler, the underlying system Vagrant uses to install plugins,
    reported an error. The error is shown below. These errors are usually
    caused by misconfigured plugin installations or transient network
    issues. The error from Bundler is:

    ERROR: Failed to build gem native extension.

    current directory: /Users/tommy/.vagrant.d/gems/2.4.3/gems/nokogiri-1.8.2/ext/nokogiri

    /opt/vagrant/embedded/bin/ruby -r ./siteconf20180415-31929-15492jz.rb extconf.rb
    checking if the C compiler accepts ... *** 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.4.0/mkmf.rb:457: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.4.0/mkmf.rb:572:in `block in try_compile'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:523:in `with_werror'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:572: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.4.0/mkmf.rb:630:in `with_cflags'
    from extconf.rb:161:in `add_cflags'
    from extconf.rb:410:in `<main>'

    To see why this extension failed to compile, please check the mkmf.log which can be found here:
    /Users/tommy/.vagrant.d/gems/2.4.3/extensions/x86_64-darwin-13/2.4.0/nokogiri-1.8.2/mkmf.log

    extconf failed, exit code 1

    Gem files will remain installed in /Users/tommy/.vagrant.d/gems/2.4.3/gems/nokogiri-1.8.2 for inspection.

    Results logged to /Users/tommy/.vagrant.d/gems/2.4.3/extensions/x86_64-darwin-13/2.4.0/nokogiri-1.8.2/gem_make.out
    __________________________________________

    I also tried the same with a "sudo" infront, but that didn't help. Exactly the same result.

    Should I bug this on GitHub ?

    Best Regards,
    Tommy Svensson
     
  2. tombensve

    tombensve Bit poster

    Messages:
    9
    I removed and reinstall Xcode as a test, but same result.
     
  3. tombensve

    tombensve Bit poster

    Messages:
    9
    Oh that (beeeep) Xcode license agreement!!! Im not a Mac developer so I in general do not run xcode.

    Anyhow, after agreeing to xcode the installation worked fine.

    Note that is is "xcodebuild -license" that you need to run in a shell.

    on: http://parallels.github.io/vagrant-parallels/docs/installation/ it would be very helpful if under "Requirements", "Make sure you have installed and accepted the xcode license, which is done by running 'xcodebuild -license' in a shell." were added.
     
    Last edited: Apr 15, 2018
  4. MikhailZ

    MikhailZ Bit poster

    Messages:
    3
    @tombensve Thank you for posting the solution!

    That issue is caused by the nokogiri gem, which is installed automatically as a dependency of "vagrant-parallels" plugin.
    That appeared not so long time ago, because previously nokogiri was bundled into a Vagrant package, so no compilation were needed on the target machine.

    Due to a specifics of nokogiri, it compiles some libs on the target machine during the installation, so it requires some command line tools like "make" and C compiler to be available. These are absent by default on clean Macs, but that's actually could be solved once by running "xcode-select --install" or "xcodebuild --license" (if XCode.app is installed).

    Anyway, you're right that we need to mention that in our docs. I'll manage to do add such notice there soon
     

Share This Page