Unable to Load rjags

2012-03-27
2012-09-01
  • Daniel Hocking
    Daniel Hocking
    2012-03-27

    I am trying to install JAGS and load rjags but am having a problem. I have
    tried the current version of JAGS (via Mac package) and version 2.2. I've
    tried installing rjags from the CRAN and an earlier version from the source. I
    have also tried on two computers (both running Mac OS 10.5.8) one with R 2.14
    and one with R 2.13. I want to wait to update my Mac OS until I finish my
    dissertation. Here is the error and current session info:

    install.packages("rjags")

    trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/leopard/contrib/2.13/rjag
    s_3-5.tgz
    '

    Content type 'application/x-gzip' length 385928 bytes (376 Kb)

    opened URL

    ==================================================

    downloaded 376 Kb

    The downloaded packages are in

    /var/folders/kK/kKOB0jqoFo0dxNiBv7rQPE+++TQ/-Tmp-//RtmpJuNUmQ/downloaded_packa
    ges

    library(rjags)

    Loading required package: coda

    Loading required package: lattice

    Error : .onLoad failed in loadNamespace() for 'rjags', details:

    call: dyn.load(file, DLLpath = DLLpath, ...)

    error: unable to load shared object '/Library/Frameworks/R.framework/Versions/
    2.13/Resources/library/rjags/libs/x86_64/rjags.so':

    dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/rjags/l
    ibs/x86_64/rjags.so, 10): Library not loaded: /usr/local/lib/libjags.3.dylib

    Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/libra
    ry/rjags/libs/x86_64/rjags.so

    Reason: image not found

    Error: package/namespace load failed for 'rjags'

    sessionInfo()

    R version 2.13.2 (2011-09-30)

    Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

    locale:

    en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

    attached base packages:

    stats graphics grDevices utils datasets methods base

    other attached packages:

    coda_0.14-6 lattice_0.19-33

    loaded via a namespace (and not attached):

    grid_2.13.2 tools_2.13.2

    Does anyone have any suggestions on a potential fix (changing path names) or
    versions that play well together within Mac OS 10.5.8? Also, any suggestions
    that involve the Terminal or building binaries would have to be explicit (or
    point me to explicit resources) because I have never done that and am clueless
    about that stuff.

    Thanks!

    Dan

     
  • Daniel Hocking
    Daniel Hocking
    2012-03-27

    I was able to find a solution. I installed JAGS 2.2 and then it wouldn't work
    with the CRAN version of rjags so I tried rjags 2.2 from sourceforge but it
    had a problem (64-bit issue). I was able to solve it by installing it through
    the Terminal using: R --arch x86_64 CMD INSTALL rjags_2.2.0-1.tar.gz. Then it
    worked without any problems.

     
  • Martyn Plummer
    Martyn Plummer
    2012-03-27

    Well, you've explained why you don't want to upgrade your Mac OS X
    installation, but this really is the best solution. Bill has done his best to
    support all releases but with 10.8 coming up this summer it is an increasingly
    hard burden.

    I don't recommend using the old 2.2.0 version of JAGS. We know there are bugs
    in there that have been fixed in more recent releases.

    Ther eis more on JAGS for Mac OS X on the
    blog