在OSX上運行gem install ffi Mountain lion會產生以下錯誤。gem install with「ruby:invalid option -H(-h將顯示有效選項)(RuntimeError)」
gem install ffi
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
/beweiche.rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb
/beweiche.rvm/rubies/ruby-1.9.3-p374/bin/ruby: invalid option -H (-h will show valid options) (RuntimeError)
Gem files will remain installed in /beweiche.rvm/gems/[email protected]/gems/ffi-1.8.1 for inspection.
這發生在任何本地擴展。 使用系統紅寶石(1.8.7)我可以用本機擴展安裝寶石。它甚至與1.9.3一起工作。但在做了「安裝寶石更新」之後,我陷入了困境。
在我的機器上安裝寶石:
bundler (1.2.3)
coderay (1.0.9)
diff-lcs (1.2.4)
graph (2.5.2)
method_source (0.8.1)
pry (0.9.12.1)
rake (10.0.3)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rubygems-bundler (1.1.0)
rvm (1.11.3.6)
slop (3.4.4)
這似乎是一個愚蠢的錯字的地方,但我找不到在哪裏。
任何提示高度讚賞。
與此同時,我在我的rvm中安裝了ruby 2.0.0-rc1。有了這個設置,我可以用本機擴展安裝寶石。我在1.9.3中將這些寶石升級到2.0.0中的相同版本,但問題仍然存在。
是'/ beweiche.rvm'正確嗎? – fotanus
是的,這是正確的。它被軟鏈接到/ Volumes/Macintosh HD/Users/beweiche/.rvm /以避免路徑中的空間。 – Bernhard