Unable to Load rjags

  • Daniel Hocking
    Daniel Hocking

    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:


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

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

    opened URL


    downloaded 376 Kb

    The downloaded packages are in



    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/

    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

    Reason: image not found

    Error: package/namespace load failed for 'rjags'


    R version 2.13.2 (2011-09-30)

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



    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.



  • Daniel Hocking
    Daniel Hocking

    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

    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