RVM Ruby 2.3.0 DevKit没有安装?

时间:2016-03-05 18:41:12

标签: ruby bundler

我正在尝试在Amazon Web服务上设置Ruby on Rails

  • 使用RVM安装的ruby-2.3.0 [x86_64]
  • rvm 1.26.11
  • Rails 5.0.0beta3
  • Capistrano 3.4

部署到服务器时,所有内容都运行良好,直到使用bundler进行依赖项安装。似乎说DevKit没有与Ruby一起安装

...
Installing mini_portile2 2.0.0
Using json 1.8.3
Installing nio4r 1.2.1 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/www/myWebsite/shared/bundle/ruby/2.3.0/gems/nio4r-1.2.1/ext/nio4r
/home/ubuntu/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160305-3397-alwetw.rb extconf.rb
checking for unistd.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
        --without-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=/home/ubuntu/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
/home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp'
        from /home/ubuntu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'
...

如何检查RVM是否正确安装了DevKit?或者问题可能在其他地方?它还提到缺少库/标题

1 个答案:

答案 0 :(得分:9)

啊,刚刚找到并读取了那个日志文件,它指出了一个丢失的库gmp

以下命令修复了问题:

sudo apt-get install libgmp3-dev