詭異的pg安裝

2021-06-12 14:16:39 字數 4026 閱讀 2950

怪事年年有 今年特別多 pg的安裝在我的gem安裝詭異榜上,也能擠進前三了

先是報錯

gem::installer::extensionbuilderror: error: failed to build gem native extension.

/home/star/.rvm/rubies/ruby-1.9.3-p194/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

–with-opt-include

–without-opt-include=$/include

–with-opt-lib

–without-opt-lib=$/lib

–with-make-prog

–without-make-prog

–srcdir=.

–curdir

–ruby=/home/star/.rvm/rubies/ruby-1.9.3-p194/bin/ruby

–with-pg

–without-pg

–with-pg-dir

–without-pg-dir

–with-pg-include

–without-pg-include=$/include

–with-pg-lib

–without-pg-lib=$/lib

–with-pg-config

–without-pg-config

–with-pg_config

–without-pg_config

gem files will remain installed in /home/star/.rvm/gems/ruby-1.9.3-p194/gems/pg-0.13.2 for inspection.

results logged to /home/star/.rvm/gems/ruby-1.9.3-p194/gems/pg-0.13.2/ext/gem_make.out

an error occured while installing pg (0.13.2), and bundler cannot continue.

make sure that `gem install pg -v 』0.13.2′` succeeds before bundling.

估計是缺少附加gem包支援,查了一下,用命令安裝了資料庫

sudo apt-get install postgresql

sudo apt-get install libpq-dev

當我認為一切都已經ok了的時候,和我大半輩子的悲催人生一樣,慘劇才剛剛開始。。。

報錯了

installing pg (0.11.0) with native extensions 

gem::installer::extensionbuilderror: error: failed to build gem native extension.

/home/duan/.rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb

checking for pg_config... yes

using config values from /usr/bin/pg_config

checking for libpq-fe.h... yes

checking for libpq/libpq-fs.h... yes

checking for pqconnectdb() in -lpq... no

checking for pqconnectdb() in -llibpq... no

checking for pqconnectdb() in -lms/libpq... no

can't find the postgresql client library (libpq)

*** 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=$/include

--with-opt-lib

--without-opt-lib=$/lib

--with-make-prog

--without-make-prog

--srcdir=.

--curdir

--ruby=/home/duan/.rvm/rubies/ruby-1.9.3-p374/bin/ruby

--with-pg

--without-pg

--with-pg-dir

--without-pg-dir

--with-pg-include

--without-pg-include=$/include

--with-pg-lib

--without-pg-lib=$/lib

--with-pg-config

--without-pg-config

--with-pg_config

--without-pg_config

--with-pqlib

--without-pqlib

--with-libpqlib

--without-libpqlib

--with-ms/libpqlib

--without-ms/libpqlib

gem files will remain installed in /home/duan/.rvm/gems/ruby-1.9.3-p374@railsduan/gems/pg-0.11.0 for inspection.

results logged to /home/duan/.rvm/gems/ruby-1.9.3-p374@railsduan/gems/pg-0.11.0/ext/gem_make.out

an error occurred while installing pg (0.11.0), and bundler cannot continue.

make sure that `gem install pg -v '0.11.0'` succeeds before bundling.

我從精神抖擻的查閱資料,到只要是個命令就放上去試試,最後到快絕望時,在乙個旮旯發現了解決方案

mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm

好像是rvm的lib編譯代替了系統的編譯導致的這個問題,感謝stackoverflow!

pg加密擴充套件的安裝 為編譯安裝的PG安裝擴充套件

讓我們以 pg stat statements 為例,前提是我們希望人們沒有刪除當初用於編譯pg的目錄。首先,看一下pg的原始碼目錄,可以看到有乙個名為 contrib的目錄。ls 在這個目錄中,我們可以看到擴充套件包 cd contrib ls 都在這裡 adminpack btree gist ...

pg如何安裝外掛程式

以自帶的外掛程式,bloom外掛程式為例 之前裝過了,現在嘗試刪除 postgres drop extension bloom psql error cannot drop extension bloom because other objects depend on it detail index...

PG 一 PostgreSQL安裝與部署

進入選擇對應的作業系統,即可獲取rpm安裝的操作步驟 安裝rpm源 yum install y 安裝資料庫 yum install y postgresql12 server 儲存安裝包 yum install postgresql12 server downloadonly downloaddir...