2017-06-28 6 views
0

GitHubでRubyプロジェクトをテストして更新するために、クラウドベースのIDE(Windowsマシン上)を設定しようとしています。私はすべての必要な部品をインストールすることに苦労しています。Cloud9(Windows 10)を使用してGeoIPをインストールする際の問題

'バンドルをインストール' それはここで失敗し、ポイントに動作します:

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

はい、同じエラーが表示されます: 'GeoIP_record_by_ipnum()を-lGeoIPでチェックしています...いいえ\ n必要があります'env ARCHFLAGS =" - arch x86_64 "'で 'gem install geoip_city --with-geoip-dir =/opt/GeoIP'を実行したときの' – huey

+0

' 64ビットです..また、彼らは 'sudo'を使ってシステムユーザとしてコマンドを実行します(システムユーザdo) –

答えて

0

これはgeoip gemのインストール手順です。 ローカルWindows 10マシンではなく、Cloud9サーバーでこれを実行する必要があります。

アプリケーションが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. 
関連する問題