[英]can't setup ruby environment - installing fii gem error
我正在嘗試為ruby項目設置環境。 但是當我運行'bundle'時,我在安裝'fii'gem時遇到錯誤:
Installing ffi (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for ffi.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.
/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
Gem files will remain installed in /Users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1 for inspection.
Results logged to /Users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
我的環境:
OS_X 10.8.4
紅寶石1.9.3p448
Xcode 4.6.3
libffi-3.0.13
請幫我修理一下。
確保您已安裝Apple Xcode和命令行工具(請參閱此屏幕截圖):
https://developer.apple.com/technologies/tools/
之后,不要忘記安裝libffi。
1)如果你使用自制軟件
brew install libffi
2)如果你使用macport
sudo port install libffi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.