Hello everyone,
I've been tasked with setting up a fresh install of shiny server on a CentOS virtual machine.
So far, I've been following the tutorial listed here:
When I try to run my application, it is giving me the message 'An error occurred, the application failed to start'. My next step was to check the logs, and I found that the error message I'm getting is the following:
Error in library(leaflet): there is no package called 'leaflet'.
I went back and looked at the code, and tried to load each package manually in R. The ones that are failing to load are the following:
- mapview
- plotKML
- leafpop
- rgdal
I'm using the following command to try to install them:
su - -c "R -e \"install.packages(c('mapview', 'plotKML', 'leafpop', 'rgdal'), repos='http://cran.rstudio.com/')\""
The error message I got says the following:
> install.packages(c('mapview', 'plotKML', 'leafpop', 'rgdal'), repos='http://cran.rstudio.com/')
Installing packages into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘units’, ‘gdtools’, ‘leafem’, ‘sf’, ‘svglite’, ‘XML’, ‘RSAGA’
trying URL 'http://cran.rstudio.com/src/contrib/units_0.6-5.tar.gz'
Content type 'application/x-gzip' length 959970 bytes (937 KB)
==================================================
downloaded 937 KB
trying URL 'http://cran.rstudio.com/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB
trying URL 'http://cran.rstudio.com/src/contrib/leafem_0.0.1.tar.gz'
Content type 'application/x-gzip' length 2844830 bytes (2.7 MB)
==================================================
downloaded 2.7 MB
trying URL 'http://cran.rstudio.com/src/contrib/sf_0.8-1.tar.gz'
Content type 'application/x-gzip' length 8469173 bytes (8.1 MB)
==================================================
downloaded 8.1 MB
trying URL 'http://cran.rstudio.com/src/contrib/svglite_1.2.3.tar.gz'
Content type 'application/x-gzip' length 43314 bytes (42 KB)
==================================================
downloaded 42 KB
trying URL 'http://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB
trying URL 'http://cran.rstudio.com/src/contrib/RSAGA_1.3.0.tar.gz'
Content type 'application/x-gzip' length 2599558 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
trying URL 'http://cran.rstudio.com/src/contrib/mapview_2.7.0.tar.gz'
Content type 'application/x-gzip' length 2029313 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
trying URL 'http://cran.rstudio.com/src/contrib/plotKML_0.6-0.tar.gz'
Content type 'application/x-gzip' length 3448183 bytes (3.3 MB)
==================================================
downloaded 3.3 MB
trying URL 'http://cran.rstudio.com/src/contrib/leafpop_0.0.5.tar.gz'
Content type 'application/x-gzip' length 1868188 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
trying URL 'http://cran.rstudio.com/src/contrib/rgdal_1.4-8.tar.gz'
Content type 'application/x-gzip' length 1698902 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
** using staged installation
configure: units: 0.6-4
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -m64 -std=gnu++11 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc -m64 -std=gnu99
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/Rtmp018p3x/R.INSTALL479336682487/units':
configure: error:
--------------------------------------------------------------------------------
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/lib64/R/library/units’
* installing *source* package ‘gdtools’ ...
** package ‘gdtools’ successfully unpacked and MD5 sums checked
** using staged installation
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcairo -lfreetype
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because cairo freetype2 was not found. Try installing:
* deb: libcairo2-dev (Debian, Ubuntu)
* rpm: cairo-devel (Fedora, CentOS, RHEL)
* csw: libcairo_dev (Solaris)
* brew: cairo (OSX)
If cairo freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘gdtools’
* removing ‘/usr/lib64/R/library/gdtools’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /usr/bin/sed
checking for pkg-config... /bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/lib64/R/library/XML’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64 -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... no
configure: svn revision: 845
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/lib64/R/library/sf’
ERROR: dependency ‘gdtools’ is not available for package ‘svglite’
* removing ‘/usr/lib64/R/library/svglite’
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/usr/lib64/R/library/RSAGA’
ERROR: dependency ‘sf’ is not available for package ‘leafem’
* removing ‘/usr/lib64/R/library/leafem’
ERROR: dependencies ‘XML’, ‘rgdal’, ‘RSAGA’ are not available for package ‘plotKML’
* removing ‘/usr/lib64/R/library/plotKML’
ERROR: dependencies ‘sf’, ‘svglite’ are not available for package ‘leafpop’
* removing ‘/usr/lib64/R/library/leafpop’
ERROR: dependencies ‘leafem’, ‘leafpop’, ‘sf’, ‘svglite’ are not available for package ‘mapview’
* removing ‘/usr/lib64/R/library/mapview’
The downloaded source packages are in
‘/tmp/Rtmp0b5kvE/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
There were 11 warnings (use warnings() to see them)
What should I do next?