vagrant up fails: Error installing chef, cannot load such file -- mkmf
I've gone through lesson 1 with no issues, but am having trouble to bring vagrant up again after.
Here's the error message:
===snip=== Building native extensions. This could take a while... ERROR: Error installing chef: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:1:in `
Gem files will remain installed in /var/lib/gems/1.9.1/gems/yajl-ruby-1.1.0 for inspection. Results logged to /var/lib/gems/1.9.1/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.out The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
===snap===
This seems to be unrelated to other solutions offered elsewhere on the forum for similar errors (specifically make missing in guest host).
I'm on an Intel Core 2 Duo on Snow Leopard.
Answers
I had a similar issue on windows 8, error reads:
Error installing chef: ERROR: Failed to build gem native extension.
The way I fixed this was by
1.) editing Vagrantfile to comment out this line: #config.vm.provision :shell, :inline => "gem install --no-ri --no-rdoc chef" 2.) adding this line to the Vagrantfile which forces a version which works with the tutorial config.vm.provision :shell, :inline => "gem install --no-ri --no-rdoc chef --version '10.14.2'"
I faced this problem and it can be fixed by doing the following :
.
$ vagrant up # and of course you will see the mentioned error
$ vagrant ssh
$ sudo apt-get install libopenssl-ruby ruby1.9.1-dev # not sure if we need openssl-ruby package
$ exit
$ vagrant halt
$ vagrant up # and you should see this error again
Note : the error mentioned might not have any impact , but it was very annoying to me
I faced this problem and it can be fixed by doing the following : $ vagrant up # and of course you will see the mentioned error $ vagrant ssh $ sudo apt-get install libopenssl-ruby ruby1.9.1-dev # not sure if we need openssl-ruby package $ exit $ vagrant halt $ vagrant up # and you should see this error again
Note : the error mentioned might not have any impact , but it was very annoying to me
Even after that, are you able to vagrant ssh? If so, Vagrant seems to have issues, sometimes, where it wants to reprovision the guest without really needing to and then fails in various ways.