こんにちは誰か助けてください!それをたくさんありがとう!pg gemをRailsにインストールできません(PostgreSQL 9.6を使用)
端末にgem pg v 0.20.0のインストールに失敗したとのメッセージが表示されるため、いくつか問題が発生します。 gem pgをインストールしようとするとこのエラーが発生します。私は現在PostgreSQL 9.6を使用しています。私は同様の質問ですべてのソリューションを試しましたが、何も動作しません.PGを再設定しようとしています。
198-195:Review minhvu$ gem install pg -- --with-pg-config=/usr/pgsql-9.6/bin/pg_config Building native extensions with: '--with-pg-config=/usr/pgsql-9.6/bin/pg_config' This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension.
current directory: /Users/minhvu/.rvm/gems/ruby-2.3.0/gems/pg-0.20.0/ext /Users/minhvu/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20170313-7016-1if947v.rb extconf.rb --with-pg-config=/usr/pgsql-9.6/bin/pg_config Using config values from /usr/pgsql-9.6/bin/pg_config sh: /usr/pgsql-9.6/bin/pg_config: No such file or directory sh: /usr/pgsql-9.6/bin/pg_config: No such file or directory * 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 --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=/Users/minhvu/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-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 /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:541:in
try_link0' from /Users/minhvu/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:556:intry_link' from extconf.rb:40:in
'To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/minhvu/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-16/2.3.0/pg-0.20.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/minhvu/.rvm/gems/ruby-2.3.0/gems/pg-0.20.0 for inspection. Results logged to /Users/minhvu/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-16/2.3.0/pg-0.20.0/gem_make.out