2017-11-17 15 views
0

レポをクローンして起動しているときに問題が発生しました。 私がbundlerを実行すると、以下のエラーが発生します。何らかの理由でgem pg_queryが好きではありません。エラーメッセージの中で私は参照してください:これは私の知識の範囲を超えています。私は同様の記事を読んでみましたが、実際の解決策を見つけることはまだありません。Rails:Gem :: Ext :: BuildError:ERROR:Gemネイティブエクステンションの構築に失敗しました

Fetching pg_query 0.11.4 
Installing pg_query 0.11.4 with native extensions 
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    /home/vagrant/.rbenv/versions/2.3.0/bin/ruby extconf.rb 
compiling src/pg_query.c 
In file included from ./src/postgres/include/postgres.h:47:0, 
       from src/pg_query_internal.h:4, 
       from src/pg_query.c:2: 
./src/postgres/include/c.h:298:9: error: '__int128' is not supported for this ta 
./src/postgres/include/c.h:298:24: warning: type defaults to 'int' in declaratio 
./src/postgres/include/c.h:299:18: error: '__int128' is not supported for this t 
make: *** [src/pg_query.o] Error 1 
cp: cannot create regular file `./../../spec/files/': No such file or directory 
creating Makefile 

make "DESTDIR=" clean 

make "DESTDIR=" 
compiling pg_query_ruby.c 
pg_query_ruby.c: In function 'pg_query_ruby_parse': 
pg_query_ruby.c:80:2: warning: ISO C90 forbids mixed declarations and code [-Wde 
pg_query_ruby.c: In function 'pg_query_ruby_normalize': 
pg_query_ruby.c:99:2: warning: ISO C90 forbids mixed declarations and code [-Wde 
pg_query_ruby.c: In function 'pg_query_ruby_fingerprint': 
pg_query_ruby.c:115:2: warning: ISO C90 forbids mixed declarations and code [-Wd 
linking shared-object pg_query/pg_query.so 
/usr/bin/ld: cannot find -lpg_query 
collect2: ld returned 1 exit status 
make: *** [pg_query.so] Error 1 

make failed, exit code 2 

Gem files will remain installed in /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/ 
Results logged to /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extens 

An error occurred while installing pg_query (0.11.4), and Bundler cannot continu 
Make sure that `gem install pg_query -v '0.11.4'` succeeds before bundling. 

私はgem install pg_query -v '0.11.4'を実行しようとしましたが、同じ結果が得られました。

+0

システムに 'postgres'データベースをインストールしましたか?また、 'Gemfile'で' pg'宝石を使い、あなたのアプリケーションで 'pg'データベースを使いました。 – puneet18

+0

あなたは2つのことができますか?1)bundler -vを使ってバンドルラーのバージョンを調べることができますか?2)Gemfile.lockの最後にチェックを入れてください。 –

+0

@Aniket Shivam Tiwari ok ...だからBundler - v 1.16と私のGemfile.lockは1.15とバンドルされています – Belder

答えて

0

こんにちは、問題はあなたのバンドラのバージョンです。あなたのGemFileはより低いバンドラーバージョンを指定しますが、あなたのシステムはより高いバンドラーバージョンを持っています。 あなたのGemfile.lockに正しいbundlerバージョンをマッチさせ、古いバージョンのbundlerをインストールしてください。以下のコードを試してください

gem install bundler -v '~> 1.15' 
bundle _1.15_ install 
+0

お返事ありがとうございます。私はそれを試み、同じエラーをまだ受けています。 'gem install bundler -v '〜1.15''を実行した後でも、' bundler -v'をチェックすると、私はまだバージョン1.16を使用していると言います。私はbundlerのバージョンをいくつかの方法で変更しようとしましたが、 'bundler -v'をチューニングしても、-v 1.16を表示しています。 – Belder

+0

まず、すべてのバージョンのbundlerをアンインストールして、上記の解決策を試してください –

関連する問題