mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 572 forks source link

Plugin install fail with ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) #464

Open tribbloid opened 8 years ago

tribbloid commented 8 years ago

Trying to install on Ruby 1.9.3 and vagrant 1.4.3. End up with the following error message:

Gem files will remain installed in /home/ubuntu/.vagrant.d/gems/gems/nokogiri-1.6.7.2 for inspection. Results logged to /home/ubuntu/.vagrant.d/gems/gems/nokogiri-1.6.7.2/ext/nokogiri/gem_make.out from /usr/lib/ruby/1.9.1/rubygems/installer.rb:540:in block in build_extensions' from /usr/lib/ruby/1.9.1/rubygems/installer.rb:515:ineach' from /usr/lib/ruby/1.9.1/rubygems/installer.rb:515:in build_extensions' from /usr/lib/ruby/1.9.1/rubygems/installer.rb:180:ininstall' from /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:297:in block in install' from /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:ineach' from /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in each_with_index' from /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:ininstall' from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:65:in block in call' from /usr/share/vagrant/plugins/commands/plugin/gem_helper.rb:42:inblock in with_environment' from /usr/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in use_ui' from /usr/share/vagrant/plugins/commands/plugin/gem_helper.rb:41:inwith_environment' from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:52:in call' from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:incall' from /usr/share/vagrant/plugins/commands/plugin/action/bundler_check.rb:20:in call' from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:incall' from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in call' from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:69:inblock in run' from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in busy' from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:69:inrun' from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:17:in action' from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:27:inexecute' from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in execute' from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:38:inexecute' from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:484:in cli' from /usr/bin/vagrant:127:in

'

Is this a compatibility issue?

IyadKandalaft commented 8 years ago

vagrant plugins are essentially Ruby gems. you can use

$ gem install vagrant-aws

to debug the issue. it's probably trying to install a gem that uses native extensions.

you can try the following

$ sudo apt-get install ruby1.9.1-dev
ghost commented 8 years ago

I'd the same issue with mac osx install with vagrant 1.8.3 I'd juste upgrade within 1.8.4 and the issue gone away https://releases.hashicorp.com/vagrant/1.8.4/

vhosakot commented 7 years ago

I saw the error Failed to build gem native extension too on CentOS 7.3 and vagrant 1.8.7.

I resolved it after installing ruby-devel and gcc (yum -y install ruby-devel gcc)