无法安装Vagrant Plugin - Gem Failing

时间:2013-08-08 18:59:34

标签: ruby vagrant

尝试为vagrant安装vagrant-digitalocean插件,但是有问题需要安装它所需的宝石。

Installing the 'vagrant-digitalocean' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:562:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /opt/vagrant/embedded/bin/ruby extconf.rb
creating Makefile

make
compiling generator.c
In file included from /opt/vagrant/embedded/include/ruby-1.9.1/ruby.h:32:0,
                 from ../fbuffer/fbuffer.h:5,
                 from generator.c:1:
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:105:14: error: size of array ‘ruby_check_sizeof_long’ is negative
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:109:14: error: size of array ‘ruby_check_sizeof_voidp’ is negative
In file included from /opt/vagrant/embedded/include/ruby-1.9.1/ruby/intern.h:43:0,
                 from /opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:1383,
                 from /opt/vagrant/embedded/include/ruby-1.9.1/ruby.h:32,
                 from ../fbuffer/fbuffer.h:5,
                 from generator.c:1:
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/st.h:67:14: error: size of array ‘st_check_for_sizeof_st_index_t’ is negative
make: *** [generator.o] Error 1


Gem files will remain installed in /home/aaron/.vagrant.d/gems/gems/json-1.8.0 for inspection.
Results logged to /home/aaron/.vagrant.d/gems/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:540:in `block in build_extensions'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:515:in `each'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:515:in `build_extensions'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:180:in `install'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:297:in `block in install'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each_with_index'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/action/install_gem.rb:49:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/action/install_gem.rb:39:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/action/runner.rb:61:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/action/runner.rb:61:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/command/base.rb:17:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/command/install.rb:44:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/command/root.rb:47:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/cli.rb:46:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/lib/vagrant/environment.rb:478:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.2.7/bin/vagrant:84:in `<top (required)>'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

2 个答案:

答案 0 :(得分:1)

当我在我的Ubuntu x86_64机器上安装了i686版本的Vagrant时发生了这种情况。不幸的是,两个版本都会成功安装,但错误的版本会以这种令人困惑的方式失败。

答案 1 :(得分:0)

我在安装类似错误的插件方面遇到了问题。

为我解决所有问题的原因是更新为:

Vagrant 1.7.2 http://www.vagrantup.com/downloads

Ruby 2.2.0 说明:http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you

注意:只是不要使用他们搞砸的复制粘贴说明,链接到他的复制粘贴片段正上方的README文件。

这100%修复了我的所有插件安装问题。

PS:使用 sudo vagrant插件安装