2013-10-25 104 views
4

我目前正在嘗試爲rails項目安裝Redcarpet gem。在小牛上安裝地毯寶石

問題是,前幾天我升級到小牛操作系統,我無法安裝它,但我不確定它是否與操作系統的變化有任何關係。

這裏是我得到的錯誤:

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

/Users/lalala/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 
creating Makefile 
make 
compiling autolink.c 
In file included from autolink.c:17: 
buffer.h:23:20: error: stdint.h: No such file or directory 
In file included from autolink.c:17: 
buffer.h:41: error: expected specifier-qualifier-list before ‘uint8_t’ 
In file included from autolink.c:18: 
autolink.h:31: warning: type defaults to ‘int’ in declaration of ‘uint8_t’ 
autolink.h:31: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token 
autolink.h:35: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.h:39: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.h:43: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.c:20:20: error: string.h: No such file or directory 
autolink.c:21:20: error: stdlib.h: No such file or directory 
autolink.c:22:19: error: stdio.h: No such file or directory 
autolink.c:23:19: error: ctype.h: No such file or directory 
autolink.c:30: warning: type defaults to ‘int’ in declaration of ‘uint8_t’ 
autolink.c:30: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token 
autolink.c:52: error: expected ‘)’ before ‘*’ token 
autolink.c:136: error: expected ‘)’ before ‘*’ token 
autolink.c:165: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.c: In function ‘sd_autolink__www’: 
autolink.c:172: warning: implicit declaration of function ‘ispunct’ 
autolink.c:172: error: ‘data’ undeclared (first use in this function) 
autolink.c:172: error: (Each undeclared identifier is reported only once 
autolink.c:172: error: for each function it appears in.) 
autolink.c:172: warning: implicit declaration of function ‘isspace’ 
autolink.c:175: warning: implicit declaration of function ‘memcmp’ 
autolink.c:175: warning: implicit declaration of function ‘strlen’ 
autolink.c:175: warning: incompatible implicit declaration of built-in function ‘strlen’ 
autolink.c:178: warning: implicit declaration of function ‘check_domain’ 
autolink.c:186: warning: implicit declaration of function ‘autolink_delim’ 
autolink.c: At top level: 
autolink.c:201: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.c: In function ‘sd_autolink__email’: 
autolink.c:210: error: ‘uint8_t’ undeclared (first use in this function) 
autolink.c:210: error: expected ‘;’ before ‘c’ 
autolink.c:212: warning: implicit declaration of function ‘isalnum’ 
autolink.c:212: error: ‘c’ undeclared (first use in this function) 
autolink.c:215: warning: implicit declaration of function ‘strchr’ 
autolink.c:215: warning: incompatible implicit declaration of built-in function ‘strchr’ 
autolink.c:225: error: expected ‘;’ before ‘c’ 
autolink.c:241: error: ‘data’ undeclared (first use in this function) 
autolink.c: At top level: 
autolink.c:256: error: expected declaration specifiers or ‘...’ before ‘uint8_t’ 
autolink.c: In function ‘sd_autolink__url’: 
autolink.c:263: error: ‘data’ undeclared (first use in this function) 
autolink.c:266: warning: implicit declaration of function ‘isalpha’ 
autolink.c:269: warning: implicit declaration of function ‘sd_autolink_issafe’ 
autolink.c:272: warning: incompatible implicit declaration of built-in function ‘strlen’ 
make: *** [autolink.o] Error 1 

顯然有一些C庫的一個問題,但是我不知道如何解決它,我一直在谷歌上搜索,但沒有發現任何有用的。

任何幫助非常感謝,謝謝!

回答

14

您是否嘗試升級到最新的XCode?

您可能需要運行XCode版本5.0.1才能在Mavericks下編譯本機擴展。 Link

編輯:

由於@Doon在他的評論中指出的那樣,你可能需要運行

xcode-select --install 

以獲取最新的命令行工具。

+0

我正在更新我的XCode,我希望是這樣! – Waclock

+0

沒有工作=(。 – Waclock

+3

xcode-select --install獲取命令行工具,看看是否有幫助。 – Doon

0

您是否嘗試刪除Gemfile.lock並再次運行軟件包安裝?

看到這個答案:

Active_Model error in rails

希望這有助於!

3

好吧我終於發現,當我升級到10.9小牛時,我的gcc壞了,所以我不得不安裝命令行工具。

如何做到這一點:

1)打開終端

2)鍵入 「Xcode中,選擇--install」(不帶引號)

3)按ENTER

4)點擊「安裝」

就是這樣!

+3

除了這給出了一個錯誤,說服務器上不可用。它轉到查找軟件進度欄,然後「無法安裝軟件,因爲它目前不能從軟件更新服務器獲得。」 –

+0

當發生這種情況時,我沒有得到任何錯誤,它的工作完美無瑕。 – Waclock