运行
gem install pg -v '0.15.1'出现错误:
构建本机扩展.这可能需要一段时间...错误:错误 安装pg:错误:无法构建gem本机扩展.
Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/askar/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If
构建失败,请使用 --with-pg-config =/path/to/pg_config检查libpq-fe.h ...否找不到'libpq-fe.h标头 * extconf.rb失败* 由于某种原因(可能缺少必需的库和/或头文件)而无法创建Makefile.查看 有关更多详细信息,请参见mkmf.log文件.您可能需要配置 选项.
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.
提供的配置选项:--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/askar/.rvm/rubies/ruby-1.9.3-p429/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include = $ {pg-dir}/include --with-pg-lib --without-pg-lib = $ {pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config
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/askar/.rvm/rubies/ruby-1.9.3-p429/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config
宝石文件将继续安装在 /home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1进行检查. 结果记录到 /home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1/ext/gem_make.out
Gem files will remain installed in /home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1 for inspection. Results logged to /home/askar/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1/ext/gem_make.out
我正在使用
推荐答案
您需要为pg gem安装本机扩展.
You need to install a native extension for the pg gem.
sudo apt-get install libpq-dev更多推荐
运行gem install pg
发布评论