【问题标题】:Installing vagrant aws plugin安装 vagrant aws 插件
【发布时间】:2015-04-02 05:05:14
【问题描述】:

我在亚马逊 EC2 linux 实例上安装了 vagrant 1.7.2。当我尝试通过发出此 vagrant plugin install vagrant-aws 命令安装 vagrant aws 插件时,我收到以下错误,

Installing the 'vagrant-aws' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing ffi (1.9.8), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.8'` succeeds before bundling.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /opt/vagrant/embedded/bin/ruby extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/vagrant/embedded/bin/ruby
        --with-ffi_c-dir
        --without-ffi_c-dir
        --with-ffi_c-include
        --without-ffi_c-include=${ffi_c-dir}/include
        --with-ffi_c-lib
        --without-ffi_c-lib=${ffi_c-dir}/
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
/opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
        from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
        from extconf.rb:16:in `<main>'


Gem files will remain installed in /home/ec2-user/.vagrant.d/gems/gems/ffi-1.9.8 for inspection.
Results logged to /home/ec2-user/.vagrant.d/gems/gems/ffi-1.9.8/ext/ffi_c/gem_make.out

请帮我解决这个问题。

TIA.,

【问题讨论】:

    标签: amazon-web-services amazon-ec2 vagrant vagrant-plugin


    【解决方案1】:

    您需要安装 GCC 编译器,可能还需要一些支持库和工具。

    对于 Amazon Linux、RHEL、CentOS 或 Fedora,请尝试

    sudo yum groupinstall 'Development Tools'
    

    对于 Debian 或 Ubuntu,请尝试

    sudo apt-get install build-essential
    

    【讨论】:

    • @DIVA 我不确定你的意思是我的解决方案是否有效。如果是这样,请接受我的回答,以便其他人看到这是一个正确的解决方案。如果没有,请发布有效的方法。
    • 你是对的。但是,我为解决该问题所做的是应用此命令在创建的 AWS EC2 实例上安装所需的开发工具 sudo yum install -y gcc ruby​​-devel libxml2 libxml2-devel libxslt libxslt-devel 然后,我发出以下命令来安装 ruby​​ ffi 包。 sudo gem install ffi --version 1.9.8
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多