2012-08-12 115 views
5

我一直試圖在OSX 10.8通過創業板安裝FFI -v '1.1.5' OSX 10.8

gem install ffi -v '1.1.5' 

,結果

ERROR: Error installing ffi: 
ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for ffi.h... no 
checking for ffi.h in /usr/local/include,/usr/include/ffi... no 
checking for rb_thread_blocking_region()... no 
checking for ruby_native_thread_p()... no 
checking for rb_thread_call_with_gvl()... no 
creating extconf.h 
creating Makefile 

make 
mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386; (if [ ! -f  "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386 
Configuring libffi for i386 
configure: WARNING: if you wanted to set the --build type, don't use --host. 
If a cross compiler is detected then cross compile mode will be used 
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi-i386': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
make[1]: *** No targets specified and no makefile found. Stop. 
make: *** ["/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi- i386/.libs/libffi_convenience.a] Error 2 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-1.1.5 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/gem_make.out 

我曾試圖按照

安裝FFI

An error occured while installing ffi (1.1.2), and Bundler cannot continue

and

Not able to install some gems after mountain lion upgrade

沒有任何運氣。

回答

0

看起來ffi堅持在系統運行64位時構建32位版本。

有最有可能的兩種方式繼續:

  1. 嘗試使用最新版本的寶石gem install ffi的 - 但這並沒有工作 - 因爲這需要固定在圖書館,
  2. 編譯32位紅寶石rvm install 1.9.3-n32 --32 - 但是這也沒有如多數圖書館最有可能將64位編譯工作,所以它可能無法編譯或編譯和現在的問題
2

我FFI安裝失敗,一個非常類似的錯誤消息:

mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386 
Configuring libffi for i386 
configure: WARNING: if you wanted to set the --build type, don't use --host. 
    If a cross compiler is detected then cross compile mode will be used 
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi-i386': 
configure: error: C compiler cannot create executables 

我發現xcrun CC的命令,並試圖手動運行它給了我,我沒有同意XCode的命令行工具,蘋果的消息'許可協議。 sudo xcrun cc安裝成功後。

$ xcrun cc 
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. 
$ sudo xcrun cc 
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode. 
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf' 
... 

```

+0

這不僅發生XCode中的第一個安裝後,但隨時蘋果改變了許可。因此,XCode更新可能會導致XCode工具停止工作,直到您接受新的許可協議。 – Technosophos 2013-10-20 15:26:02