2017-06-28 38 views
0

我试图设置一个基于云的IDE(在Windows机器上)来测试和更新GitHub上的Ruby项目。我很难安装所有必需的部件。使用Cloud9安装GeoIP时出现的问题(Windows 10)

'捆绑安装' 工程,以一个点的话,就无法在这里:

checking for iconv_open() in iconv.h... yes 
checking for GeoIP_record_by_ipnum() in -lGeoIP... no 
you must have geoip c library installed! 
. 
. 
An error occurred while installing geoip-c (0.9.1), and Bundler cannot continue. 
Make sure that `gem install geoip-c -v '0.9.1'` succeeds before bundling. 

所有这些失败:

gem install geoip-c 
gem install geoip-c -v '0.9.1' 
gem install geoip-c -- --with-geoip-dir=/opt/GeoIP 

与此错误消息:

ERROR: Error installing geoip-c: 
ERROR: Failed to build gem native extension. 

current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/geoip-c-0.9.1/ext/geoip 
/usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20170628-2852-11bgk28.rb extconf.rb 
checking for iconv_open() in iconv.h... yes 
checking for GeoIP_record_by_ipnum() in -lGeoIP... no 
you must have geoip c library installed! 

去过现在抓了我的脑子几天 - 任何帮助感激地赞赏。

+0

你看了这篇文章吗? https://stackoverflow.com/questions/2748168/error-installing-geoip-city-gem#2754397 –

+0

是的,我得到同样的错误:'在-lGeoIP中检查GeoIP_record_by_ipnum()...没有\ n你必须有geoip c library installed!' – huey

+0

在那篇文章中,他们使用'env ARCHFLAGS =“ - arch x86_64”'运行'gem install geoip_city - --with-geoip-dir =/opt/GeoIP'“,以便指定系统是64位..他们也以'sudo'(系统用户)的系统用户身份运行该命令, –

回答

0

这是来自geoip gem的安装说明。 您需要在Cloud9服务器上执行此操作,而不是在本地Windows 10计算机上执行此操作。

您的应用程序在cloud9托管的Linux服务器上运行,您需要访问该服务器终端(黑白窗口),以便您可以在Linux主机上安装和配置一些实用程序。

这说明如何打开终端上CLOUD9 https://docs.c9.io/docs/terminal

这是geoip的,你需要遵循这些对于Linux,如果你是在CLOUD9 Linux服务器的安装说明。

https://github.com/mtodd/geoip#install

因此,也许这仅仅是与Windows不兼容。

Install

Some variation of the following should work.

Install the GeoCity C library. You can get it from MaxMind. For example, I like to install mine in /opt/GeoIP, so I do this:

tar -zxvf GeoIP-1.4.3.tar.gz cd GeoIP-1.4.3 ./configure --prefix=/opt/GeoIP make && sudo make install

On Mac OS X, you can install using homebrew :

brew install geoip 

Linux platforms utilizing Apt have several packages available:

geoip-bin 
geoip-database 
libgeoip-dev Now install the geoip gem 

gem install geoip-c -- --with-geoip-dir=/opt/GeoIP

Alternatively, if you installed libgeoip using homebrew:

gem install geoip-c Download the GeoLite City database file in binary format at http://www.maxmind.com/app/geolitecity Maybe this 

direct link will work. I put this file in

/opt/GeoIP/share/GeoIP/GeoLiteCity.dat

If you installed libgeoip using homebrew then put it in:

/usr/local/share/GeoIP/GeoLiteCity.dat 

If you are a paying customer, you will download the files required below:

MaxMind Customer Downloads

You will want to get the City Rev1 data file and Organization files at minimum. Use it!

See above for usage details.

Hints

Might need to set

export ARCHFLAGS="-arch i386"

to be able to compile the gem.

Example:

env ARCHFLAGS="-arch i386" gem install geoip-c -- --with-geoip-dir=/opt/GeoIP You might find this shell script helpful to install the C library.