1

I had recently posted a question about a unicode display issue linked here. The problem then was the 'cli' package bug in the version cli v2.0.0. This bug had been brought up and has been solved on the master branch on GitHub by the developer. I am trying to install the same using remotes::install_github("r-lib/cli"). RStudio connects to GitHub fine, downloads the package, begins installing it, goes onto the step for building the package and then returns an error. The error message is copied below:

Error: (converted from warning) Setting LC_CTYPE failed, using "C"
Execution halted
Error: Failed to install 'cli' from GitHub:
  (converted from warning) installation of package '/var/folders/n0/__v02y5j02sby1w2_39185sh0000gn/T//Rtmp5HnvTL/file865408954cc/cli_2.0.0.9000.tar.gz' had non-zero exit status

Session information: R version 3.6.1 macOS Catalina

Steps taken to solve the problem: 1.Have tried using the 'devtools' package to do the same; Same error message 2.Have reinstalled the Xcode developer tools on the system 3.Tried removing and reinstalling 'cli'. I can install from CRAN with the same bug in it; still cannot install from GitHub repo.

Any thoughts would be appreciated.

Brian
  • 7,900
  • 1
  • 27
  • 41
sk1536
  • 69
  • 5
  • 1
    Works fine for me on 3.6.0 and Catalina. You might get better luck by opening an issue on github with the developer. – pgcudahy Dec 20 '19 at 20:55
  • can't reproduce this error either. Running on x86_64 Linux; R 3.6.1 – mischva11 Dec 20 '19 at 21:19
  • Thank you for checking it out. @pgcudahy. The error is probably with my system. Not sure what though. The same error comes up when trying to install any other package from GitHub. – sk1536 Dec 22 '19 at 09:39
  • LC_CTYPE has to do with locales. What is your output from `Sys.getlocale(category="LC_CTYPE")`? If it gives an error you might try `Sys.setlocale(category = "LC_CTYPE", "en_US.UTF-8")` and then try to install. – pgcudahy Dec 22 '19 at 23:01
  • @pgcudahy `Sys.getlocale(category="LC_CTYPE")` gives me output as `"C"`. Is that what is supposed to happen? – sk1536 Dec 24 '19 at 18:00
  • No, that means that a locale isn't set. This is a unix problem and not an R problem, explanation at https://unix.stackexchange.com/questions/87745/ (the second answer). Have you set a locale in the `System Preferences` app in the `Language and Region` section (like at https://apple.stackexchange.com/questions/21096/ ?). Another possible solution is at https://stackoverflow.com/questions/7165108 to edit your /etc/profile. Otherwise you'll have to set your locale with Sys.setlocale() each R session. – pgcudahy Dec 24 '19 at 20:51

1 Answers1

1

The same commands worked when I ran them in R console through terminal as superuser (sudo R from terminal). The packages compiled properly and installed.

Two pages which helped are linked below:

  1. [Installing a package inside RStudio fails on macOS Catalina

  2. [https://support.rstudio.com/hc/en-us/articles/200554786-Problem-Installing-Packages]

sk1536
  • 69
  • 5