4

尝试vagrant-digitalocean为 vagrant 安装插件,但在安装所需的 gem 时遇到问题。

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>'
4

2 回答 2

1

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

于 2013-09-07T02:02:07.067 回答
0

我在安装具有类似错误的插件时遇到问题。

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

流浪者 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 插件安装

于 2015-03-15T11:56:08.830 回答