Search code examples
pluginsvagrantosx-mavericks

Vagrant cannot install nokogiri-dependent plugins


I'm trying to install the rackspace plugin for vagrant (1.5.1):

vagrant plugin install vagrant-rackspace

But it complains

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:

An error occurred while installing nokogiri (1.6.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.6.1' succeeds before bundling.

However gem install nokogiri -v '1.6.1' and /Applications/Vagrant/embedded/bin/gem install nokogiri -v '1.6.1' both work.

I've looked at a bunch of SO threads and blog posts. Things I've tried that have not worked

  1. Running xcode-select --install
  2. Installing full xcode
  3. brew install gcc-4.2
  4. Remove rvm and rvm version of ruby
  5. Install nokogiri w/ built-in (mac) ruby and vagrant-embedded ruby

Despite the fact that nokogiri installs fine (#5 above) without sudo on both counts, vagrant plugin install vagrant-rackspace still fails...

So, in summary, I can install the nokogiri plugin, however I cannot install the vagrant rackspace plugin, can you help me get the plugin installed?

Related threads

Full output of vagrant plugin install vagrant-rackspace --debug


Solution

  • I'm on OSX Mavericks and this worked for me:

    Set as environment property:

    NOKOGIRI_USE_SYSTEM_LIBRARIES=1 
    

    Then install as usual:

    vagrant plugin install vagrant-rackspace