2016-09-18 119 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