我試圖在Mac上安裝rpostgresql。我希望能夠使用IP地址連接到服務器,並將數據讀入數據幀。我從CRAN下載的軟件包,跑到下面一行:在Mac OS X 10.7.2上安裝RPostgresql
install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
這開始編譯軟件包,但導致出現以下錯誤信息:
> install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* 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 for pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/include -I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o
make: gcc-4.2: No such file or directory
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz’ had non-zero exit status
我通過諮詢枕着rpostgresql網頁(1,2),但很多建議都超過了一年,所以我認爲可能會有更多關於如何安裝此軟件包的建議。
GCC不再包含在Xcode 4.2,這就是爲什麼失敗。我不確定這種情況下的解決方法是什麼,最好聯繫RPostreSQL開發人員。 –
你確定嗎? http://hints.macworld.com/article.php?story=20110318050811544 –
@DWin GCC不再包含在Xcode中?是。您鏈接的文章也說明了這一點。 –