2017-06-28 42 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.