我有麻烦推着我的Rails应用程序的Heroku到/获得“PG”宝石安装?(I am having

2019-10-20 21:35发布

本来我不能把我的轨道4应用的Heroku因为我的数据库是SQLite的,所以现在我一直在试图安装PostgreSQL的宝石(“PG”),但我没有任何运气。 这是错误消息我得到了我的终端上运行包安装后:

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 ***

运行后
创业板安装PG -v '0.17.1' --with-PG-配置

我得到了我的终端该错误:

ERROR:  While executing gem ... (Gem::Requirement::BadRequirementError)
 Illformed requirement ["0.17.1--with-pg_config"]
/project$ gem install pg -v '0.17.1'--with-pg-config
ERROR:  Could not find a valid gem 'pg' (= 0.17.1.pre..pre.with.pre.pg.pre.config) in   

any repository
ERROR:  Possible alternatives: pg

谢谢您的帮助。

Answer 1:

如果您没有安装的Postgres,你可能想一起去:

sudo apt-get install postgresql
sudo apt-get install libpq-dev

按照gem install pgbundle

如果你已经安装的Postgres和运行gem install pg是不行的,你必须运行which pg_config到你的路径pg_config和运行gem install pg -- --with-pg-config= output_from_previous_command



文章来源: I am having trouble pushing my rails app to Heroku/getting the 'pg' gem to install?