Search code examples
rreadxl

Error during installation of readxl in RStudio


I am using R version 3.4.4 (2018-03-15) and RStudio Version 1.1.456 and I am getting this error when I am trying to install the readxl extension:

* installing *source* package ‘utf8’ ...
** package ‘utf8’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c as_utf8.c -o as_utf8.o
as_utf8.c:17:10: fatal error: assert.h: No such file or directory
 #include <assert.h>
          ^~~~~~~~~~
compilation terminated.

Solution

  • This happened with me because of outdated R version.

    Kindly update your R and try again. For instructions regarding updating R, follow this.

    Make sure you update R to 3.5.2.