Fedora 24 - Ruby on Rails安装错误

时间:2016-09-18 18:40:44

标签: ruby-on-rails fedora

我尝试在我新的Fedora 24安装上安装rails。我按照本教程https://developer.fedoraproject.org/tech/languages/ruby/ror-installation.html进行了操作。

但我收到了这个错误:

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

current directory: /usr/local/share/gems/gems/nio4r-1.2.1/ext/nio4r
/usr/bin/ruby -r ./siteconf20160918-22847-14vriyi.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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate    an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:587:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1091:in `block in have_header'
from /usr/share/ruby/mkmf.rb:942:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:350:in `block in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:346:in `postpone'
from /usr/share/ruby/mkmf.rb:941:in `checking_for'
from /usr/share/ruby/mkmf.rb:1090:in `have_header'
from extconf.rb:3:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/usr/local/lib64/gems/ruby/nio4r-1.2.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/share/gems/gems/nio4r-1.2.1 for inspection.
Results logged to /usr/local/lib64/gems/ruby/nio4r-1.2.1/gem_make.out
我用google搜索解决方案,但我没有成功。你能给我建议吗? 谢谢

1 个答案:

答案 0 :(得分:0)

您是否根据日志中的错误消息安装了&#34;开发工具&#34;

  

编译器无法生成可执行文件。 (RuntimeError)

     

您必须先安装开发工具。

来自the linked Fedora ROR installation guide

sudo dnf group install "C Development Tools and Libraries"