Cannot install stringi since Xcode Command Line Tools update
Issue resolved by removing ~/.R/Makevars
.
Exact steps taken:
- Close all instances of RStudio
- Run in Terminal:
mv ~/.R/Makevars ~/.R/old_Makevars
(note that the file has been renamed rather than deleted in case it may need to be restored) - Re-open RStudio.
- Install stringi normally with
install.packages("stringi")
This question might be useful to discover the contents/purpose of ~/.R/Makevars.
package 'stringi' does not work after updating to R3.2.1
I had the same problem. Marek's comment above, that install.packages is looking for the source instead of the binary because it's newer, was correct for me too. But his suggestion to use the "options" line didn't work for me for some reason. This, however, did work:
install.packages("stringi",type="mac.binary")
This is much easier than trying to install a compiler through Xcode to process the source package.
Error: Could not find build tools necessary to build stringi when trying devtools::install_github()
You can try running
/usr/bin/clang --version
If command line tools are installed, this should just report the version of clang
installed; otherwise, you'll be prompted to install Xcode + Command Line Tools. (This is just a simple way of ensuring command line tools indeed are installed)
If you run
devtools::install_github("Rexamine/stringi")
in a plain R console, outside of RStudio, what do you see? Can you update your post with the errors (if any) printed to the console?
You might also try updating RStudio to the preview release (https://www.rstudio.com/products/rstudio/download/preview/) to see if that helps.
It seems like this is likely a bug in RStudio's build tools detection; you might try explicitly disabling it with:
options(buildtools.check = function(action) TRUE)
This should ensure that devtools
doesn't try to call RStudio's build tools detection code and just assume that everything is available.
stringi install error: configure: error: C compiler cannot create executables
I got the same problem when updating the stringi
package. As was stated here https://github.com/gagolews/stringi/issues/291, the issue wasn't with stringi but instead in ~/.R/Makevars. Installation was successful upon deleting this file using rm ~/.R/Makevars
in your command line.
How to update Xcode Command Line Tools?
For future travelers, here's a version-agnostic approach. First, run softwareupdate --list
. This will probably take a couple of minutes. When it's done, you'll see a bulleted (with an asterisk) output like this:
$ softwareupdate --list
Software Update Tool
Finding available software
Software Update found the following new or updated software:
* Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1
Command Line Tools (macOS High Sierra version 10.13) for Xcode (10.1), 190584K [recommended]
Find the bullet that refers to the Xcode command line tools. Copy that entire line (except the asterisk...). In the above case, you would copy: Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1
Then, run the install command (as shown by Brendan Shanks) with what you copied inside quotes:
softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1"
Related Topics
Code Folding for Individual Chunks in R Markdown
R: Need Finite 'Ylim' Values in Function
Click on Cross Domain Iframe Element Using Rselenium
Separate a Column into Multiple Columns Using Tidyr::Separate with Sep=""
Convert Byte Encoding to Unicode
Changing Names in a List of Dataframes
Mapping Variable to Hexagon Size with Geom_Hex
Variable Results with Dplyr Summarise, Depending on Output Variable Naming
Check Which Elements of a Vector Is Between the Elements of Another One in R
Total Mean & Mean by Groups in R with Dplyr
Change Standard Error Color for Geom_Smooth
Creating "Word" Cloud of Phrases, Not Individual Words in R
How to Find Correct Executable with Sys.Which on Windows
Read Column Names as Date Format
Adding an Image to a Datatable in R
Help Understand the Error in a Function I Defined in R
Object Not Found Error with Ggplot2 When Adding Shape Aesthetic