前提・実現したいこと
Rails tutorial のソースコードを自分の cloud9 で動くようにしたい
そのために bundle install を成功させたい
発生している問題・エラーメッセージ
Installing pg 0.18.4 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
該当のソースコード
$ bundle install Fetching gem metadata from https://rubygems.org/......... Using rake 12.0.0 Using concurrent-ruby 1.0.5 Using i18n 0.8.6 Using minitest 5.10.3 Using thread_safe 0.3.6 Using tzinfo 1.2.3 Using activesupport 5.1.2 Using builder 3.2.3 Using erubi 1.6.1 Using mini_portile2 2.2.0 Using nokogiri 1.8.0 Using rails-dom-testing 2.0.3 Using loofah 2.0.3 Using rails-html-sanitizer 1.0.3 Using actionview 5.1.2 Using rack 2.0.3 Using rack-test 0.6.3 Using actionpack 5.1.2 Using nio4r 2.1.0 Using websocket-extensions 0.1.2 Using websocket-driver 0.6.5 Using actioncable 5.1.2 Using globalid 0.4.0 Using activejob 5.1.2 Using mime-types-data 3.2016.0521 Using mime-types 3.1 Using mail 2.6.6 Using actionmailer 5.1.2 Using activemodel 5.1.2 Using arel 8.0.0 Using activerecord 5.1.2 Using ansi 1.5.0 Using bindex 0.5.0 Using bundler 1.16.2 Using byebug 9.0.6 Using coderay 1.1.1 Using coffee-script-source 1.12.2 Using execjs 2.7.0 Using coffee-script 2.4.1 Using method_source 0.8.2 Using thor 0.19.4 Using railties 5.1.2 Using coffee-rails 4.2.2 Using ffi 1.9.18 Using formatador 0.2.5 Using rb-fsevent 0.10.2 Using rb-inotify 0.9.10 Using listen 3.0.8 Using lumberjack 1.0.12 Using nenv 0.3.0 Using shellany 0.0.1 Using notiffany 0.1.1 Using slop 3.6.0 Using pry 0.10.4 Using guard 2.13.0 Using guard-compat 1.2.1 Using guard-minitest 2.4.4 Using multi_json 1.12.1 Using jbuilder 2.7.0 Using jquery-rails 4.3.1 Using ruby-progressbar 1.8.1 Using minitest-reporters 1.1.14 Fetching pg 0.18.4 Installing pg 0.18.4 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/pg-0.18.4/ext /usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180805-23669-1cl2md4.rb extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib To see why this extension failed to compile, please check the mkmf.log which can be found here: /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-0.18.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.4.1/gems/pg-0.18.4 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-0.18.4/gem_make.out An error occurred while installing pg (0.18.4), and Bundler cannot continue. Make sure that `gem install pg -v '0.18.4' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: pg
ここに問題に対して試したことを記載してください。
brew install postgresql
やら
gem install pg -v '0.18.4'
をすると
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/pg-0.18.4/ext
/usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180805-23772-18rythe.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
とでてしまいます、、、
補足情報(FW/ツールのバージョンなど)
質問できているかすら不安ですが大変困っていますので回答よろしくお願いいたしますm(_ _)m
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/06 15:45