2014-03-26 65 views
0

我想安裝此寶石,summarize,通過運行:無法安裝總結創業板OSX,失蹤glib.h

gem install summarise 

我得到的錯誤:

ERROR: Failed to build gem native extension. 
... 
In file included from article.c:25: 
./libots.h:24:10: fatal error: 'glib.h' file not found 

但當我嘗試運行:

brew install glib 

我得到:

glib-2.38.2 already installed 

接下來要做什麼的任何想法?


編輯: 我已經嘗試過,因爲:

export CPPFLAGS=-I/usr/local/Cellar/glib/2.38.2/include/glib-2.0/ 
export LDFLAGS=-L/usr/local/Cellar/glib/2.38.2/lib/ 
export PKG_CONFIG_PATH=/usr/local/Cellar/glib/2.38.2/lib/pkgconfig/ 

...這似乎已經讓我移動到一個新的錯誤:

compiling article.c 
article.c:107:37: warning: passing 'const unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign] 
if ((aWord == NULL) || (0==strlen(aWord)) ||(NULL==aLine)) return; 
           ^~~~~ 
/usr/include/string.h:82:28: note: passing argument to parameter here 
size_t strlen(const char *); 
         ^
article.c:109:68: warning: passing 'const unsigned char *' to parameter of type 'const gchar *' (aka 'const char *') converts between pointers to integer types with different sign [-Wpointer-sign] 
aLine->words = g_list_append (aLine->words, (gpointer) g_strdup (aWord)); 
                   ^~~~~ 
/usr/local/Cellar/glib/2.38.2/include/glib-2.0/glib/gstrfuncs.h:216:52: note: passing argument to parameter 'str' here 
gchar*    g_strdup   (const char *str) G_GNUC_MALLOC; 

.. 。

dictionary.c:28:10: fatal error: 'libxml/xmlmemory.h' file not found 
#include <libxml/xmlmemory.h> 

回答

1

我遇到了完全相同的問題,我推薦使用這個gem代替:https://github.com/deepfryed/ots它提供了OSX指令,並且爲我無縫地安裝在Mavericks上。

+0

這就是我最終使用的。從我可以告訴它做很多相同的工作。乾杯。 –

1

您可能需要t o安裝glib-devel,它將包含glib庫的源代碼和頭文件。

+0

我已經添加了對我的問題的更新,如何安裝'glib-revel'? 'brew install glib2-devel'似乎找不到任何東西。 –

+0

看起來你也需要libxml-devel。 – mcfinnigan

+0

安裝這些命令的命令是什麼? brew似乎沒有爲這些名稱找到任何東西 –