2016-10-28 17 views
2

CentOS 7(x64)LinuxベースのマシンでEnterprise DBのワンクリックインストーラを使用してhereが利用可能なPostgreSQL 9.6をインストールしました。今、私はR StudioをPostgresに接続しようとしています。そうするために、私はR StudioでRPostgreSQLパッケージをインストールしようとしたが、私は次のようなエラーになっています:PostgreSQLの9.6のCentOS 7のR StudioにRPostgreSQLパッケージをインストールできない

> install.packages("RPostgreSQL") 
Installing package into ‘/home/jk/R/x86_64-redhat-linux-gnu-library/3.3’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/src/contrib/RPostgreSQL_0.4-1.tar.gz' 
Content type 'unknown' length 476204 bytes (465 KB) 
================================================== 
downloaded 465 KB 

* installing *source* package ‘RPostgreSQL’ ... 
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked 
checking for gcc... gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking target system type... x86_64-unknown-linux-gnu 
checking for pg_config... no 
configure: checking for PostgreSQL header files 
configure: Checking include /usr/include. 
configure: Checking include /usr/include/pgsql. 
configure: Checking include /usr/include/postgresql. 
configure: Checking include /usr/local/include. 
configure: Checking include /usr/local/include/pgsql. 
configure: Checking include /usr/local/include/postgresql. 
configure: Checking include /usr/local/pgsql/include. 
configure: Checking include /usr/local/postgresql/include. 
configure: Checking include /opt/include. 
configure: Checking include /opt/include/pgsql. 
configure: Checking include /opt/include/postgresql. 
configure: Checking include /opt/local/include. 
configure: Checking include /opt/local/include/postgresql. 
configure: Checking include /opt/local/include/postgresql84. 
configure: Checking include /sw/opt/postgresql-8.4/include. 
configure: Checking include /Library/PostgresPlus/8.4SS/include. 
configure: Checking include /sw/include/postgresql. 
configure: Checking lib /usr/lib. 
configure: Checking lib /usr/lib/pgsql. 
configure: Checking lib /usr/lib/postgresql. 
configure: Checking lib /usr/local/lib. 
configure: Checking lib /usr/local/lib/pgsql. 
configure: Checking lib /usr/local/lib/postgresql. 
configure: Checking lib /usr/local/pgsql/lib. 
configure: Checking lib /usr/local/postgresql/lib. 
configure: Checking lib /opt/lib. 
configure: Checking lib /opt/lib/pgsql. 
configure: Checking lib /opt/lib/postgresql. 
configure: Checking lib /opt/local/lib. 
configure: Checking lib /opt/local/lib/postgresql. 
configure: Checking lib /opt/local/lib/postgresql84. 
configure: Checking lib /sw/opt/postgresql-8.4/lib. 
configure: Checking lib /Library/PostgresPlus/8.4SS/lib. 
configure: Checking lib /sw/lib. 
checking for "/libpq-fe.h"... no 
configure: creating ./config.status 
config.status: creating src/Makevars 
** libs 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-DBI.c -o RS-DBI.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-PQescape.c -o RS-PQescape.o 
In file included from RS-PQescape.c:7:0: 
RS-PostgreSQL.h:23:26: fatal error: libpq-fe.h: No such file or directory 
# include "libpq-fe.h" 
        ^
compilation terminated. 
make: *** [RS-PQescape.o] Error 1 
ERROR: compilation failed for package ‘RPostgreSQL’ 
* removing ‘/home/jk/R/x86_64-redhat-linux-gnu-library/3.3/RPostgreSQL’ 
Warning in install.packages : 
installation of package ‘RPostgreSQL’ had non-zero exit status 

をインストールディレクトリは、上記のエラーにあるとは思えない/opt/PostgreSQL/9.6/binです。誰かが私にこのエラーを解決するのを手伝ってもらえますか?

EDIT 1:@lavajumperの提案に

おかげで、私は上記のエラーを処分しました。しかし、今、いくつかの欠けているHTMLリンクを示すこのエラーが表示されます。

> install.packages("RPostgreSQL") 
Installing package into ‘/home/jk/R/x86_64-redhat-linux-gnu-library/3.3’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/src/contrib/RPostgreSQL_0.4-1.tar.gz' 
Content type 'unknown' length 476204 bytes (465 KB) 
================================================== 
downloaded 465 KB 

* installing *source* package ‘RPostgreSQL’ ... 
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked 
checking for gcc... gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking target system type... x86_64-unknown-linux-gnu 
checking for pg_config... no 
configure: checking for PostgreSQL header files 
configure: Checking include /usr/include. 
configure: Checking lib /usr/lib. 
configure: Checking lib /usr/lib/pgsql. 
configure: Checking lib /usr/lib/postgresql. 
configure: Checking lib /usr/local/lib. 
configure: Checking lib /usr/local/lib/pgsql. 
configure: Checking lib /usr/local/lib/postgresql. 
configure: Checking lib /usr/local/pgsql/lib. 
configure: Checking lib /usr/local/postgresql/lib. 
configure: Checking lib /opt/lib. 
configure: Checking lib /opt/lib/pgsql. 
configure: Checking lib /opt/lib/postgresql. 
configure: Checking lib /opt/local/lib. 
configure: Checking lib /opt/local/lib/postgresql. 
configure: Checking lib /opt/local/lib/postgresql84. 
configure: Checking lib /sw/opt/postgresql-8.4/lib. 
configure: Checking lib /Library/PostgresPlus/8.4SS/lib. 
configure: Checking lib /sw/lib. 
checking for "/usr/include/libpq-fe.h"... yes 
configure: creating ./config.status 
config.status: creating src/Makevars 
** libs 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-DBI.c -o RS-DBI.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-PQescape.c -o RS-PQescape.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-PostgreSQL.c -o RS-PostgreSQL.o 
RS-PostgreSQL.c: In function ‘RS_PostgreSQL_createDataMappings’: 
RS-PostgreSQL.c:446:5: warning: passing argument 1 of ‘Rf_protect’ from incompatible pointer type [enabled by default] 
PROTECT(flds = RS_DBI_allocFields(num_fields)); 
^ 
In file included from /usr/include/R/Rdefines.h:36:0, 
      from S4R.h:64, 
      from RS-DBI.h:29, 
      from RS-PostgreSQL.h:25, 
      from RS-PostgreSQL.c:17: 
/usr/include/R/Rinternals.h:1348:6: note: expected ‘SEXP’ but 
argument is of type ‘struct RS_DBI_fields *’ 
SEXP Rf_protect(SEXP); 
    ^
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-pgsql-copy.c -o RS-pgsql-copy.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-pgsql-getResult.c -o RS-pgsql-getResult.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-pgsql-pqexec.c -o RS-pgsql-pqexec.o 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RS-pgsql-pqexecparams.c -o RS-pgsql-pqexecparams.o 
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o RPostgreSQL.so RS-DBI.o RS-PQescape.o RS-PostgreSQL.o RS-pgsql-copy.o RS-pgsql-getResult.o RS-pgsql-pqexec.o RS-pgsql-pqexecparams.o -L -lpq -L/usr/lib64/R/lib -lR 
installing to /home/jk/R/x86_64-redhat-linux-gnu-library/3.3/RPostgreSQL/libs 
** R 
** inst 
** preparing package for lazy loading 
Creating a generic function for ‘format’ from package ‘base’ in package ‘RPostgreSQL’ 
Creating a generic function for ‘print’ from package ‘base’ in package ‘RPostgreSQL’ 
Creating a generic function for ‘summary’ from package ‘base’ in package ‘RPostgreSQL’ 
** help 
*** installing help indices 
converting help for package ‘RPostgreSQL’ 
finding HTML links ... done 
PostgreSQL        html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL /man/PostgreSQL.Rd:26: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQL.Rd:76: missing file link ‘dbUnloadDriver’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQL.Rd:84: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQL.Rd:89: missing file link ‘dbCommit’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQL.Rd:90: missing file link ‘dbRollback’ 
PostgreSQLConnection-class    html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLConnection-class.Rd:20: missing file link ‘dbCommit’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLConnection-class.Rd:32: missing file link ‘dbRollback’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLConnection-class.Rd:34: missing file link ‘dbWriteTable’ 
PostgreSQLDriver-class     html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLDriver-class.Rd:25: missing file link ‘dbUnloadDriver’ 
PostgreSQLObject-class     html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLObject-class.Rd:20: missing file link ‘isSQLKeyword’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLObject-class.Rd:22: missing file link ‘SQLKeywords’ 
    PostgreSQLResult-class     html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLResult-class.Rd:31: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/PostgreSQLResult-class.Rd:32: missing file link ‘fetch’ 
S4R          html 
dbApply-methods       html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbApply-methods.Rd:27: missing file link ‘fetch’ 
dbApply         html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbApply.Rd:37: missing file link ‘fetch’ 
dbCallProc-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbCallProc-methods.Rd:31: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbCallProc-methods.Rd:32: missing file link ‘dbCommit’ 
dbCommit-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbCommit-methods.Rd:36: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbCommit-methods.Rd:37: missing file link ‘dbCommit’ 
dbConnect-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbConnect-methods.Rd:58: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbConnect-methods.Rd:59: missing file link ‘dbCommit’ 
dbDataType-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbDataType-methods.Rd:33: missing file link ‘isSQLKeyword’ 
dbDriver-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbDriver-methods.Rd:26: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbDriver-methods.Rd:44: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbDriver-methods.Rd:45: missing file link ‘dbCommit’ 
dbGetInfo-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbGetInfo-methods.Rd:47: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbGetInfo-methods.Rd:48: missing file link ‘dbCommit’ 
dbListTables-methods     html 
dbObjectId-class      html 
dbReadTable-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbReadTable-methods.Rd:119: missing file link ‘isSQLKeyword’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbReadTable-methods.Rd:124: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbReadTable-methods.Rd:125: missing file link ‘dbCommit’ 
dbSendQuery-methods      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbSendQuery-methods.Rd:40: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbSendQuery-methods.Rd:41: missing file link ‘dbCommit’ 
dbSetDataMappings-methods    html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/dbSetDataMappings-methods.Rd:33: missing file link ‘fetch’ 
fetch-methods       html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/fetch-methods.Rd:46: missing file link ‘dbCommit’ 
isPostgresqlIdCurrent     html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/isPostgresqlIdCurrent.Rd:34: missing file link ‘fetch’ 
make.db.names-methods     html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/make.db.names-methods.Rd:69: missing file link ‘dbWriteTable’ 
postgresqlBuildTableDefinition   html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/postgresqlBuildTableDefinition.Rd:41: missing file link ‘fetch’ 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/postgresqlBuildTableDefinition.Rd:42: missing file link ‘dbCommit’ 
postgresqlDBApply      html 
Rd warning: /tmp/Rtmp15353Q/R.INSTALL161911b14876/RPostgreSQL/man/postgresqlDBApply.Rd:75: missing file link ‘fetch’ 
postgresqlSupport      html 
summary-methods       html 
** building package indices 
** testing if installed package can be loaded 
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
unable to load shared object '/home/jk/R/x86_64-redhat-linux-gnu-library /3.3/RPostgreSQL/libs/RPostgreSQL.so': 
/home/jk/R/x86_64-redhat-linux-gnu-library/3.3/RPostgreSQL/libs/RPostgreSQL.so: undefined symbol: PQfmod 
Error: loading failed 
Execution halted 
ERROR: loading failed 
* removing ‘/home/jk/R/x86_64-redhat-linux-gnu-library/3.3/RPostgreSQL’ 
Warning in install.packages : 
installation of package ‘RPostgreSQL’ had non-zero exit status 
+0

RのPostgresライブラリは主に、PostgresデータベースAFAIKを呼び出すラッパーで、管理者やアプリケーションがそれを呼び出すのとほとんど同じです。私はここで何かが間違っているかもしれないと思う。 –

+0

それは可能性がありますが、「致命的なエラー:libpq-fe.h:そのようなファイルやディレクトリはありません」というエラーが表示されます。おそらく、PostgreSQL9.6のインストールにヘッダーファイルがないかもしれません。 –

+0

これで作業しましょう。あなたは管理者を起動できますか、またはコマンドラインからPostgresを起動できますか? –

答えて

0

わかりました。問題は自分で分かりました。 @Manoj(thisリンク)の回答は、2番目のエラーを解決するのに役立ちました。言及リンク、のみこれらのディレクトリ内のライブラリのためのRPostgreSQLチェックによると:

/usr/lib 
/usr/lib/pgsql 
/usr/lib/postgresql 
/usr/local/lib 
/usr/local/lib/pgsql 
/usr/local/lib/postgresql 
/usr/local/pgsql/lib 
/usr/local/postgresql/lib 
/opt/lib 
/opt/lib/pgsql 
/opt/lib/postgresql 
/opt/local/lib 
/opt/local/lib/postgresql 
/opt/local/lib/postgresql84 
/sw/opt/postgresql-8.4/lib 
/Library/PostgresPlus/8.4SS/lib 
/sw/lib 

だから私は/usr/libにPostgresのインストールディレクトリからライブラリファイルをコピーし、R Studioで、次のようにコマンドを再度実行してスーパーユーザーとして

install.packages('RPostgreSQL', dependencies=TRUE, repos='http://cran.rstudio.com/') 

それが機能しました! :)

関連する問題