PENGZhaoqing / CourseSelect

校园选课系统样本 (a template for course selection system by Ruby on Rails)
https://courseselect.herokuapp.com/
MIT License
105 stars 205 forks source link

bundle instll error #90

Closed wangpengabc closed 5 years ago

wangpengabc commented 5 years ago

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: /home/wangpeng/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/pg-0.18.4/ext

/home/wangpeng/.rbenv/versions/2.2.4/bin/ruby -I /home/wangpeng/.rbenv/versions/2.2.4/lib/ruby/site_ruby/2.2.0 -r ./siteconf20191021-26662-au4592.rb extconf.rb checking for pg_config... yes Using config values from /usr/bin/pg_config You need to install postgresql-server-dev-NN for building a server-side extension or libpq-dev for building a client-side application. You need to install postgresql-server-dev-NN for building a server-side extension or libpq-dev for building a client-side application. 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=/home/wangpeng/.rbenv/versions/2.2.4/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:

/home/wangpeng/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/pg-0.18.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/wangpeng/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/pg-0.18.4 for inspection. Results logged to /home/wangpeng/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/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 'http://gems.ruby-china.com/' succeeds before bundling.

想问一下解决方法是什么

wangpengabc commented 5 years ago

I can find in FAQ about pg