2016-09-18 121 views
0

我尝试在我新鲜的Fedora 24安装上安装rails。我遵循本教程https://developer.fedoraproject.org/tech/languages/ruby/ror-installation.htmlFedora 24 - Ruby on Rails安装错误

但我得到这个错误:

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搜索解决方案,但我没有成功。你能给我建议吗? 谢谢

+0

你检查mkmf.log文件?你可以发布它包含的内容吗?正如错误所述,该文件位于'/ usr/local/lib64/gems/ruby​​/nio4r-1.2.1/mkmf.log'中。 – SteveTurczyn

回答

0

您是否已经根据日志中的错误消息安装了“开发工具”?

The compiler failed to generate an executable file. (RuntimeError)

You have to install development tools first.

the linked Fedora ROR installation guide

sudo dnf group install "C Development Tools and Libraries" 
+0

是的,我提到我遵循本教程https://developer.fedoraproject .org/tech/languages/ruby​​/ror-installation.html,这是第一步。 – martyn

+0

根据那个错误消息,它看起来像那些包没有被安装或者不能用于你的Ruby进程。我没有使用Fedora/Yum,但是看起来您可以使用:yum groupinfo“C开发工具和库”来验证它们是否已安装。 – pdoherty926