2012-07-15 46 views
28

我試圖用這個教程Mac上安裝Memcached的: http://tugdualgrall.blogspot.de/2011/11/installing-memcached-on-mac-os-x-and.html 但是當我嘗試的./configure 它說: 配置:錯誤:在$ PATH 沒有找到可接受的C編譯器當我嘗試做它說: 使 SH:使:找不到命令 SH-3.2#百勝安裝使 SH:百勝:命令未找到 SH-3.2#apt-get的安裝使 SH:apt-get的:命令沒有找到安裝「製造」在Mac

我必須提到,我有Xcode,但它仍然無法正常工作。 我真的是新的Mac,所以請考慮到這一點:) 我真的很感謝你的幫助 謝謝!

+0

Xcode應該給你make和相關工具。什麼'printenv PATH | tr「:」「\ n」'return? – dmckee 2012-07-15 18:40:03

+0

它提供: 的/ opt/local/bin目錄 的/ opt/local/sbin中 在/ usr/bin中 /bin中 /usr/sbin目錄 /sbin目錄 在/ usr/local/bin目錄 在/ usr/X11/bin中 /usr/local/git/bin – 2012-07-15 19:15:21

+0

最近版本的Xcode在捆綁軟件本身中安裝他們的工具,例如'/應用/ Xcode.app /內容/開發人員的/ usr/bin'。嘗試把它放在你的'$ PATH'中。 – 2012-07-15 19:20:59

回答

83

如果您有Xcode 4.3或更新的命令行工具(如make),默認情況下不會安裝。在Xcode首選項中,進入「下載」選項卡,在「組件」下按「命令行工具」旁邊的「安裝」按鈕。你已經成功地下載和安裝命令行工具後,你也應該在終端上鍵入以下命令,以確保所有的Xcode命令行工具切換使用4.3版本:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 

一旦一切都成功安裝你應該在/ usr/bin中看到make和其他命令行開發者工具。

+0

完美!非常感謝torrey! – 2012-07-15 22:08:55

+0

謝謝效果很好。 – JamesC 2012-11-18 22:57:20

+0

爲什麼它不適合我? 還在說:-bash:make:command not found – itsazzad 2012-12-26 21:34:46

3

torrey.lyons的答案,的Xcode - >首選項 - >下載它下命令行工具說:

Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.

因此,我能夠運行使用命令xcrun make製作工具。