无法安装Vagrant插件 - Gem失败

4
尝试为vagrant安装vagrant-digitalocean插件,但它在安装所需的gems时出现了问题。
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个回答

1

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


你能详细说明一下吗?我遇到了类似的问题,但不明白你的意思。(我正在Windows机器上安装) - MZB
我只是想说,如果你正在运行64位操作系统,应该安装64位版本的Vagrant,而不是32位版本。后者会成功安装,但在运行时会失败(至少这是我曾经的经验)。 - mikhail_b

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接