bundle geoip-c - 给出错误“您必须安装 geoip c 库”
Posted
技术标签:
【中文标题】bundle geoip-c - 给出错误“您必须安装 geoip c 库”【英文标题】:bundle geoip-c - gives error "you must have geoip c library installed" 【发布时间】:2015-11-17 01:59:18 【问题描述】:试图捆绑一个有gem geoip-c
但得到的应用
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/durrantm/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20151116-4194-j
cyop7.rb extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
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
如何克服这个问题?
我可以brew install geoip
和现在brew list geoip
显示
/usr/local/Cellar/geoip/1.6.7/bin/geoiplookup
/usr/local/Cellar/geoip/1.6.7/bin/geoiplookup6
/usr/local/Cellar/geoip/1.6.7/include/ (2 files)
/usr/local/Cellar/geoip/1.6.7/lib/libGeoIP.1.dylib
/usr/local/Cellar/geoip/1.6.7/lib/pkgconfig/geoip.pc
/usr/local/Cellar/geoip/1.6.7/lib/ (2 other files)
/usr/local/Cellar/geoip/1.6.7/share/man/ (2 files)
20:59:38 durrantm Michaels-MacBook-Air /Users/durrantm/eq/lynx master
【问题讨论】:
【参考方案1】:要解决此问题,请将以下环境变量设置为 geoip 库并使用此命令包含目录:
env LDFLAGS=`pkg-config geoip --libs-only-L` CFLAGS=`pkg-config geoip --cflags-only-I` gem install geoip-c
【讨论】:
【参考方案2】:适用于 Linux 环境
geoip-c gem 自述文件中提到,您需要先安装以下库
sudo apt-get install geoip-bin
sudo apt-get install geoip-database
sudo apt-get install libgeoip-dev
【讨论】:
【参考方案3】:只安装 libgeoip-dev 就足够了
【讨论】:
以上是关于bundle geoip-c - 给出错误“您必须安装 geoip c 库”的主要内容,如果未能解决你的问题,请参考以下文章
您需要为您的 APK 或 Android App Bundle 使用不同的版本代码
您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端服务
要上传 Android App Bundle,您必须注册 Google Play 的 App Signing
导轨。 'Bundle install' 在 Ruby 版本升级 (Windows) 后给出了 'bad interpreter: No such file or directory' 错误