安装geoip_city gem时出错 [英] Error installing geoip_city gem

查看:268
本文介绍了安装geoip_city gem时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试安装geoip_city gem时遇到错误。我已经将GeoIP C库安装到了/ opt / GeoIP,但是这个gem似乎没有选择它。我试过了:

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


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

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



<所有这些都会输出这个错误:

 构建本机扩展。这可能需要一段时间... 
错误:安装geoip_city时出错:
错误:无法构建gem本机扩展。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-geoip-lib = / opt / GeoIP / lib
检查对于GeoIP_record_by_ipnum()in -lGeoIP ... no
您必须安装geoip c库!
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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文件将保持安装在/ Library / Ruby / Gems /1.8/gems/geoip_city-0.2.0进行检查。
结果记录到/Library/Ruby/Gems/1.8/gems/geoip_city-0.2.0/gem_make.out


<尽管如此,cantorrodista仍然处于正确的轨道上。我必须像这样运行命令:
sudo env ARCHFLAGS = - arch i386gem install geoip_city - --with-geoip-dir = / opt / GeoIP


I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried:

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

all of which output this error:

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

解决方案

cantorrodista was on the right track, though. I had to run the command like this: sudo env ARCHFLAGS="-arch i386" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP

这篇关于安装geoip_city gem时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆