2015-11-03 70 views
-1

使用installrails.com安裝滑軌,直到我去的第一步,一切工作正常:無法在OSX El Capitan上安裝導軌?

gem install rails --no-ri --no-rdoc 

打字後,端子輸出:

users-MacBook:~ user$ gem install rails --no-ri --no-rdoc 
Building native extensions. This could take a while... 
ERROR: Error installing rails: 
ERROR: Failed to build gem native extension. 

/Users/user/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151102- 1332-1uwdkth.rb extconf.rb 
checking if the C compiler accepts ... yes 
checking if the C compiler accepts -Wno-error=unused-command-line- argument-hard-error-in-future... no 
Building nokogiri using packaged libraries. 
----- 
The file "/usr/include/iconv.h" is missing in your build environment, 
which means you haven't installed Xcode Command Line Tools properly. 

To install Command Line Tools, try running `xcode-select --install` on 
terminal and follow the instructions. If it fails, open Xcode.app, 
select from the menu "Xcode" - "Open Developer Tool" - "More Developer 
Tools" to open the developer site, download the installer for your OS 
version and run it. 
----- 
*** 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=/Users/user/.rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME) 
--help 
--clean 
--use-system-libraries 
--enable-static 
--disable-static 
--with-zlib-dir 
--without-zlib-dir 
--with-zlib-include 
--without-zlib-include=${zlib-dir}/include 
--with-zlib-lib 
--without-zlib-lib=${zlib-dir}/lib 
--enable-cross-build 
--disable-cross-build 

extconf failed, exit code 1 

Gem files will remain installed in /Users/user/.rvm/gems/ruby- 2.2.1/gems/nokogiri-1.6.6.2 for inspection. 
Results logged to /Users/user/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/nokogiri-1.6.6.2/gem_make.out 
users-MacBook:~ user$ 

一些研究,我發現我也許能後通過安裝Xcode命令行工具來修復它,但我需要進一步的幫助。

+3

你運行過'xcode-select --install'嗎? – doublesharp

+0

如果您閱讀完整的錯誤消息,它會告訴您到底需要做什麼:) – doublesharp

回答

2

錯誤消息告訴你到底出了什麼問題:

文件「/usr/include/iconv.h」在構建環境中缺少, 這意味着你還沒有安裝的Xcode命令行正確的工具。

,以及如何解決這個問題:

要安裝的命令行工具,嘗試 終端運行xcode-select --install,並按照指示。如果失敗,請打開Xcode.app, 從菜單「Xcode」 - 「Open Developer Tool」 - 「更多開發人員 工具」中選擇以打開開發人員站點,下載OS 版本的安裝程序並運行它。

請檢查:

  1. 你已經安裝的Xcode?
  2. 您是否安裝了Xcode命令行工具?
  3. 您是否至少打開過一次Xcode(每次更新後再次打開)並且您是否接受許可證?
+0

非常好。這幫助我安裝了appium控制檯('gem install --no-rdoc --no-ri appium_console'),因爲我在El Capitan上遇到了同樣的錯誤 –

相關問題