2012-06-21 33 views
0

我正嘗試在mac os x lion上安裝datamapper gem,但在安裝sqlite適配器時未能構建gem本機擴展(請參閱下面的終端輸出)。我從谷歌和其他堆棧溢出問題找到的兩種解決方案是使用sudo或安裝Xcode,但我已經使用sudo並從應用商店安裝了Xcode 4.3.3。在獅子上安裝datamapper gem時出錯

sudo gem install dm-sqlite-adapter 密碼: 構建本機擴展。這可能需要一段時間... 錯誤:安裝dm-sqlite-adapter時出錯: 錯誤:未能構建gem本機擴展。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb找不到頭文件在/System/Library/Frameworks/Ruby.framework紅寶石/Versions/1.8/usr/lib/ruby/ruby.h

Gem文件將保留安裝在/Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.8中進行檢查。 結果記錄到/Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.8/ext/do_sqlite3/gem_make.out

gem_make.out

/系統/資源庫/框架/紅寶石。 framework/Versions/1.8/usr/bin/ruby​​ extconf.rb mkmf.rb在/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby找不到ruby的頭文件。 h

+0

您可以將錯誤行粘貼到'gem_make.out'文件的末尾嗎?他們可能會告訴我們如何解決這個問題。 – Amir

+0

@AmirF用gem_make.out文件的內容更新問題 – Ben

回答

1

好吧,看起來你錯過了Xcode首選項 - 一般的Xcode命令行工具。

如果沒有命令行工具,則會生成上述錯誤,您可以從http://developer.apple.com/downloads(需要免費Apple ID)下載它們。

從Xcode的CLI工具的說明:

This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OS X SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make. If you use Xcode, these tools are also embedded within the Xcode IDE, and can be installed on your system using the Downloads preferences pane within Xcode 4.3 and later. This package requires Mac OS X 10.7.3 or later.

而且,看到這個article這表明你之前卸載Xcode的爲好。

+0

還有一件事 - 考慮使用https://rvm.io/或https://github.com/sstephenson/rbenv來管理幾個ruby安裝(即安裝Ruby 1.9.3)。它會爲你省去麻煩。 – Amir