1

I'm trying to install the "RPostgreSQL" package (using R 2.13.1, Mac OS X Snow Leopard).

When I run install.packages("RPostgreSQL"), I get this error:

In getDependencies(pkgs, dependencies, available, lib) :
  package ‘RPostgreSQL’ is not available (for R version 2.13.1)

So I tried downloading from source, and running r CMD INSTALL RPostgreSQL_0.1-7.tar.gz, and it seemed to install fine, but when I call library(RPostgreSQL), I get this error:

`Error: package 'RPostgreSQL' is not installed for 'arch=i386'`

So I randomly tried rerunning r CMD INSTALL RPostgreSQL_0.1-7.tar.gz, which again seemed to install fine, but then I get a slightly different error when I call library(RPostgreSQL):

'RPostgreSQL' is not a valid installed package

Any idea what's wrong? Is the package simply not supported in the latest version of R, so that I should downgrade my version of R (I guess, by uninstalling my current version and finding an older one?) if I want to use it?

grautur
  • 29,955
  • 34
  • 93
  • 128
  • which version of OS X are you running. On 10.7 I was able to download the source from the google code repo and build it using `install.packages(gzipped_source_path, repos = NULL, type="source")` I had xcode installed before installing, naturally. I didn't expect it to be that easy, and I'm not sure why I was able to build it when others have lots of troubles. Quirk of 10.7 maybe? – JD Long Sep 12 '11 at 15:07
  • @JD Long: I'm running on 10.6.6, so that might be it. (Or maybe it's because of the R version? Not sure if you're running 2.13.1 as well.) Anyways, I ended up switching to RpgSQL instead, which seems to work fine =). – grautur Sep 13 '11 at 23:07

2 Answers2

3

The package is not building on CRAN. See the CRAN page for details, which indicates that the MacOS X binary is not available. The package is failing to install. Here is the install log:

* installing *source* package 'RPostgreSQL' ...
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... 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: error: File libpq-fe.h not in ; installation may be broken.
ERROR: configuration failed for package 'RPostgreSQL'
* removing '/Volumes/Tiger/Builds/Rdev-web/QA/Simon/packages/leopard-universal/results/2.13/RPostgreSQL.Rcheck/RPostgreSQL'

You should contact the package maintainer for further information.

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
3

The RPostgreSQL repo on Google Code has clear documentation on installing RPostgreSQL on Mac OS X, I suggest you start there.

Neil also tries to keep those up to date, so if this for whatever reason fails for you, you can always come to the Google Groups mailing list.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • You could also post to r-sig-Mac mailing list if the link above does not help. – Carl Witthoft Sep 11 '11 at 15:19
  • I tried following that documentation, but now I get a different error (about loading `RPostgreSQL.so`), so I posted my question to the mailing list at https://groups.google.com/forum/?pli=1#!topic/rpostgresql-dev/EzyH3B1wJes. – grautur Sep 11 '11 at 19:27
  • Good approach, with luck Neil can help you. I don't have an OS X box myself. – Dirk Eddelbuettel Sep 11 '11 at 19:37