質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 3

Ruby on Rails3はRubyによって書かれたオープンソースのウェブフレームワークです。Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

解決済

1回答

1046閲覧

bundler:installエラー、checking for pg_config... no

behoimi80

総合スコア62

Ruby on Rails 3

Ruby on Rails3はRubyによって書かれたオープンソースのウェブフレームワークです。Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2021/07/16 09:09

環境
CentOS 7.9
Rails 5.1.0
ruby 2.4.0

デプロイをすると

bundle exec cap production deploy

下記エラーが出る

00:33 bundler:install 01 $HOME/.rbenv/bin/rbenv exec bundle install --path /home/w… 01 Gem::Ext::BuildError: ERROR: Failed to build gem native e… 01 01 current directory: 01 /home/webapps/abc/shared/bundle/ruby/2.4.0/gem… 01 /home/user/.rbenv/versions/2.4.0/bin/ruby -r 01 ./siteconf20210716-12875-1niw102.rb extconf.rb 01 checking for pg_config... no 01 No pg_config... trying anyway. If building fails, please … 01 --with-pg-config=/path/to/pg_config 01 checking for libpq-fe.h... no 01 Can't find the 'libpq-fe.h header 01 *** extconf.rb failed *** 01 Could not create Makefile due to some reason, probably la… 01 libraries and/or headers. Check the mkmf.log file for mo… 01 need configuration options. 01 01 Provided configuration options: 01 --with-opt-dir 01 --without-opt-dir 01 --with-opt-include 01 --without-opt-include=${opt-dir}/include 01 --with-opt-lib 01 --without-opt-lib=${opt-dir}/lib 01 --with-make-prog 01 --without-make-prog 01 --srcdir=. 01 --curdir 01 --ruby=/home/user/.rbenv/versions/2.4.0/bin/$(RUBY_BA… 01 --with-pg 01 --without-pg 01 --enable-windows-cross 01 --disable-windows-cross 01 --with-pg-config 01 --without-pg-config 01 --with-pg_config 01 --without-pg_config 01 --with-pg-dir 01 --without-pg-dir 01 --with-pg-include 01 --without-pg-include=${pg-dir}/include 01 --with-pg-lib 01 --without-pg-lib=${pg-dir}/lib 01 01 To see why this extension failed to compile, please check… 01 be found here: 01 01 /home/webapps/kit-downloader/shared/bundle/ruby/2.4.0/ext… 01 01 extconf failed, exit code 1 01 01 Gem files will remain installed in 01 /home/webapps/abc/shared/bundle/ruby/2.4.0/gem… 01 inspection. 01 Results logged to 01 /home/webapps/abc/shared/bundle/ruby/2.4.0/ext… 01 01 An error occurred while installing pg (0.21.0), and Bundl… 01 Make sure that `gem install pg -v '0.21.0'` succeeds befo… : : Results logged to /home/webapps/abc/shared/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/pg-0.21.0/gem_make.out An error occurred while installing pg (0.21.0), and Bundler cannot continue. Make sure that `gem install pg -v '0.21.0'` succeeds before bundling.

ググって色々試しましたがダメでした。
何か解決はありますでしょうか?

験したこと

sudo yum -y install mysql-devel bundle config build.pg --with-pg-config=/usr/pgsql-9.6/bin/pg_config bundle install --path vendor/bundle

pg(0.21.0)はインストールされており、参照の問題だと思うのですが、うまくいきません。
他に何かアドバスがあればご教授ください。

参考
pgがインストールできない

gem install pgしてNo pg_configとなる対処法

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

すみませんでした。
bundler:installエラーではなく、capistranoで本番とローカル(github)のバージョン違いが問題でした。
ご迷惑をおかけしました。

投稿2021/07/19 02:59

behoimi80

総合スコア62

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問