3

I just upgraded R and R Studio to the most recent versions.

I am trying to load the package RHRV and R Studio aborts the session due to a fatal error. It is associated with the following error:

loading package: tcltk

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Loading required package: tkrplot

The command:

library("tcltk")

gives the following error message:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1

Running the following command crashes R Studio:

library("tkrplot")

Here is some additional information of interest:

sessionInfo("tcltk")

R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] tcltk

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.2         Formula_1.2-1       cluster_2.0.3       magrittr_1.5            splines_3.2.2       MASS_7.3-43         grDevices_3.2.2    
 [8] munsell_0.4.2       colorspace_1.2-6    lattice_0.20-33     minqa_1.2.4            stringr_1.0.0       plyr_1.8.3          tools_3.2.2        
[15] utils_3.2.2         nnet_7.3-10         grid_3.2.2          gtable_0.1.2            nlme_3.1-121        latticeExtra_0.6-26 stats_3.2.2        
[22] datasets_3.2.2      survival_2.38-3     lme4_1.1-10         digest_0.6.8        base_3.2.2          Matrix_1.2-2        gridExtra_2.0.0    
[29] RColorBrewer_1.1-2  nloptr_1.0.4        reshape2_1.4.1      ggplot2_1.0.1       acepack_1.3-3.3     graphics_3.2.2      effects_3.0-4      
[36] rpart_4.1-10        stringi_1.0-1       methods_3.2.2       scales_0.3.0            Hmisc_3.17-0        lmerTest_2.0-29     foreign_0.8-65     
[43] proto_0.3-10

sessionInfo("tkrplot")
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
character(0)

other attached packages:
[1] tkrplot_0.0-23

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.2         Formula_1.2-1       cluster_2.0.3       magrittr_1.5        splines_3.2.2       MASS_7.3-43         grDevices_3.2.2    
 [8] munsell_0.4.2       colorspace_1.2-6    lattice_0.20-33     minqa_1.2.4         stringr_1.0.0       plyr_1.8.3          tcltk_3.2.2        
[15] tools_3.2.2         utils_3.2.2         nnet_7.3-10         grid_3.2.2           gtable_0.1.2        nlme_3.1-121        latticeExtra_0.6-26
[22] stats_3.2.2         datasets_3.2.2      survival_2.38-3     lme4_1.1-10         digest_0.6.8        base_3.2.2          Matrix_1.2-2       
[29] gridExtra_2.0.0     RColorBrewer_1.1-2  nloptr_1.0.4        reshape2_1.4.1      ggplot2_1.0.1       acepack_1.3-3.3     graphics_3.2.2     
[36] effects_3.0-4       rpart_4.1-10        stringi_1.0-1       methods_3.2.2       scales_0.3.0        Hmisc_3.17-0        lmerTest_2.0-29    
[43] foreign_0.8-65      proto_0.3-10             

Matt

MrFlick
  • 195,160
  • 17
  • 277
  • 295
Matt Jordan
  • 567
  • 1
  • 5
  • 14
  • does it work in R (i.e. is it an RStudio-specific problem)? If so it might be better for the RStudio user forum ... – Ben Bolker Dec 02 '15 at 22:08
  • It doesn't seem to work in R either but I've changed my tags to Rstudio as this is what I'm using – Matt Jordan Dec 02 '15 at 22:12
  • If it doesn't work in R either, that's a more basic problem and [r] would be the more appropriate tag. Does `library("tcltk")` produce the same error by itself? To have a hope of proceeding further we need to know the results of `sessionInfo(); packageVersion("tcltk")` – Ben Bolker Dec 02 '15 at 22:13
  • The package version for "tcltk" is 3.2.2. running library("tcltk") produces the same error but doesn't crash R Studio. It seems like it is actually crashing on "tkrplot". As soon as I try to run library("tkrplot") R Studio crashes – Matt Jordan Dec 02 '15 at 23:17
  • so what is `packageVersion("tkrplot")` ? `sessionInfo()` ? – Ben Bolker Dec 02 '15 at 23:17
  • Ben, thanks so much. I added the information you needed into my original post above. As for tkrplot, I can't load the library and thus when packageVersion("tkrplot") comes up with: Error in packageDescription(pkg, lib.loc = lib.loc, fields = "Version") : object 'tkrplot' not found. – Matt Jordan Dec 02 '15 at 23:25
  • this might conceivably be an El Capitan-related bug. Have you tried http://stackoverflow.com/questions/32893412/command-line-tools-not-working-os-x-el-capitan (reached by googling "El Capitan xcrun") ? – Ben Bolker Dec 03 '15 at 03:32

2 Answers2

0

With many thanks to Ben, I can provide a solution to the problem. The issue is that El Capitan has a somewhat unknown xcode issue.

Open the Terminal App and enter:

xcode-select --install

It takes a few minutes to load the patch needed to run xcode. The error described above is highlighted in several instances, and this was the workaround.

I then restarted my computer and loaded the package "tkrplot" directly from the source with the code:

install.packages("tkrplot", type="source")

Once I completed these three steps, I was able to load the package "RHRV" and the associated packages "tkrplot" and "tcltk" without issue.

Matt Jordan
  • 567
  • 1
  • 5
  • 14
  • 1
    It’s hard to considering installing command line tools as a “work around”. Having system tools is a basic, fundamental preparation. – IRTFM Jul 30 '21 at 04:30
0

You'll only have the "invalid active developer path" problem when you build package from source. If you use the pre-compiled versions from CRAN, you won't have to worry about it. Try

install.packages("tkrplot", type="binary")
MrFlick
  • 195,160
  • 17
  • 277
  • 295