2013-01-08 52 views
3

我想使用thinking-sphinx-raspell gem來允許我們網站上的搜索結果具有你的意思。它適用於我的開發機器(Mountain Lion),但是我很難在Heroku Cedar上部署它。使用Vulcan在Heroku上安裝raspell gem

該寶石取決於raspell寶石,而寶石取決於aspell。由於aspell不包含在Heroku Cedar堆棧中,我使用Vulcan在Heroku機器上編譯它,將二進制文件添加到我的git存儲庫,然後將其推送到Heroku。我更詳細地描述了步驟here

這在捆綁階段導致錯誤:

Installing raspell (1.3) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
/usr/local/bin/ruby extconf.rb 
checking for ruby.h... yes 
checking for aspell.h... no 
checking for main() in -laspell... no 
creating Makefile 
make 
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -I/opt/local/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o raspell.o -c raspell.c 
In file included from raspell.c:2: 
raspell.h:6:20: error: aspell.h: No such file or directory 

如果我理解正確的話,就aspell.h這種依賴在raspell寶石extconf.rb設置:

have_header("aspell.h") 

我把該項目的bin目錄中的頭文件。不是最好的地方,但我不認爲這是問題所在。這對應於Heroku文件系統上的/app/bin。我添加了此路徑到PATH,C_INCLUDE_PATH,CPLUS_INCLUDE_PATH並且還設置了CFLAGS-I/app/bin

我做錯了什麼?或者我正在嘗試一些在Heroku上不起作用的東西?

回答