gpt4 book ai didi

postgresql - cloudbees dev cloud + Postgresql + ruby​​gems pg (native extension) 怎么用?

转载 作者:行者123 更新时间:2023-11-29 13:04:46 26 4
gpt4 key购买 nike

我想在cloudbees dev cloud中使用postgres,我看了这篇文章: http://wiki.cloudbees.com/bin/view/DEV/PostgreSQL

但是,我运行bundle,我得到了错误:

Installing pg (0.15.1) .......

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby 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}/ --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/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}/ --with-pg-config --without-pg-config --with-pg_config --without-pg_config

Gem files will remain installed in /home/jenkins/.gem/ruby/1.9.1/gems/pg-0.15.1 for inspection. Results logged to /home/jenkins/.gem/ruby/1.9.1/gems/pg-0.15.1/ext/gem_make.out An error occurred while installing pg (0.15.1), and Bundler cannot continue. Make sure that gem install pg -v '0.15.1' succeeds before bundling.

接下来我该做什么?

最佳答案

有两种方法可以解决这个问题:

1) 使用上面的变通方法,通过添加

PATH=/scratch/jenkins/postgresqls/postgresql-9.2.4-x86_64/bin:$PATH

这并不理想,因为我们只是要移动这条路径以支持拉取请求构建

2) 结合这两个步骤

在您的构建中,您需要结合 PostgreSQL 和 Ruby 安装步骤,以便正确配置环境。

我个人建议使用脚本进行构建 - ./bin/run-ci - 而不是将所有内容都输入 Jenkins。

这可以让您的构建过程更改得到控制和记录 - 并让您能够非常快速地在多个构建服务器上推出更改。

关于postgresql - cloudbees dev cloud + Postgresql + ruby​​gems pg (native extension) 怎么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17136198/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com