2010-04-30 207 views
1

當我嘗試安裝geoip_city gem時,我總是收到錯誤消息。我已經將GeoIP C庫安裝到了/ opt/GeoIP,但是這個gem似乎沒有選擇它。我已經試過:安裝geoip_city gem時出錯

Building native extensions. This could take a while... 
ERROR: Error installing geoip_city: 
    ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-geoip-lib=/opt/GeoIP/lib 
checking for GeoIP_record_by_ipnum() in -lGeoIP... no 
you must have geoip c library installed! 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 
    --with-geoip-dir 
    --without-geoip-dir 
    --with-geoip-include 
    --without-geoip-include=${geoip-dir}/include 
    --with-geoip-lib=${geoip-dir}/lib 
    --with-GeoIPlib 
    --without-GeoIPlib 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/geoip_city-0.2.0 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/geoip_city-0.2.0/gem_make.out 

回答

1

cantorrodista是在正確的軌道上,雖然。我必須像這樣運行命令: sudo env ARCHFLAGS =「 - arch i386」gem install geoip_city - --with-geoip-dir =/opt/GeoIP

0

我認爲你必須通過ARCHFLAGS參數以指示要一個64位arquitecture就可以了::

sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP 


sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib 


sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP --with-geoip-lib=/opt/GeoIP/lib 

所有輸出這個錯誤的

須藤ENV ARCHFLAGS = 「 - 拱x86_64的」 創業板安裝geoip_city - --with-geoip的-DIR = /選擇/ geoip的

+0

感謝您的回覆!雖然我的系統只有32位。 – tomeara 2010-05-02 16:00:07