Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 无法安装Vagrant插件-Gem失败_Ruby_Vagrant - Fatal编程技术网

Ruby 无法安装Vagrant插件-Gem失败

Ruby 无法安装Vagrant插件-Gem失败,ruby,vagrant,Ruby,Vagrant,尝试为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 b

尝试为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>'
安装“vagrant digitalocean”插件。这可能需要几分钟。。。
/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:562:“在构建扩展中的块中救援”:错误:构建gem本机扩展失败。(Gem::Installer::ExtensionBuildError)
/opt/vagrant/embedded/bin/ruby extconf.rb
创建Makefile
制作
编译生成器.c
在/opt/vagrant/embedded/include/ruby-1.9.1/ruby.h:32:0中包含的文件中,
from../fbuffer/fbuffer.h:5,
来自发电机。c:1:
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:105:14:错误:数组“ruby\u check\u sizeof\u long”的大小为负
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:109:14:错误:数组“ruby\u check\u sizeof\u voidp”的大小为负
在/opt/vagrant/embedded/include/ruby-1.9.1/ruby/intern.h:43:0中包含的文件中,
来自/opt/vagrant/embedded/include/ruby-1.9.1/ruby/ruby.h:1383,
从/opt/vagrant/embedded/include/ruby-1.9.1/ruby.h:32,
from../fbuffer/fbuffer.h:5,
来自发电机。c:1:
/opt/vagrant/embedded/include/ruby-1.9.1/ruby/st.h:67:14:错误:数组“st_check_for_sizeof_st_index_t”的大小为负
make:**[generator.o]错误1
Gem文件仍将安装在/home/aron/.vagrant.d/gems/gems/json-1.8.0中以供检查。
结果记录到/home/aron/.vagrant.d/gems/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
来自/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'
来自/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:515:in'build_extensions'
来自/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:180:in'install'
来自/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:297:in'block in install'
来自/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in'each'
来自/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in'each_with_index'
来自/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:'block in call'
来自/opt/vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/plugin/gem_-helper.rb:42:“使用_环境阻止”
from/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/user\u interaction.rb:40:in'use\u 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'
来自/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:正在“行动”
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`'
from/opt/vagrant/bin/。/embedded/gems/bin/vagrant:23:在“加载”中
from/opt/vagrant/bin/。/embedded/gems/bin/vagrant:23:in`'

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

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

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

流浪汉1.7.2

Ruby 2.2.0 说明:

注意:只是不要使用他的复制粘贴说明,因为它们乱七八糟,请链接到自述文件。他在复制粘贴片段的正上方有链接

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


PS:Usesudovagrant插件安装

您能详细说明一下吗?我也有类似的问题,无法理解你的意思。(我正在Windows计算机上安装)。我的意思是,如果您运行的是64位操作系统,您应该安装64位版本的Vagrant,而不是32位版本。后者将成功安装,但在运行时失败(至少这是我的经验)。