Error building rsvg: librsvg-2.0 was not found.

1,321 views
Skip to first unread message

Matt Brigida

unread,
Mar 30, 2016, 10:40:10 PM3/30/16
to ShinyApps Users
I think librsvg2 needs to be installed on the shinyapps.io servers.  I have an app which requires the following libraries:

library(shiny)
library
(devtools)
devtools
::install_github('rich-iannone/DiagrammeR')
library
(DiagrammeR)

I can run the app locally, but when I try and push it to shinyapps I get the following error.  

** package ‘rsvg’ successfully unpacked and MD5 sums checked
Package librsvg-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `librsvg-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'librsvg-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lrsvg
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because librsvg-2.0 was not found. Try installing:
 * deb: librsvg2-dev (Debian, Ubuntu, etc)
 * rpm: librsvg2-devel (Fedora, EPEL)
 * csw: librsvg_dev, sunx11_devel (Solaris)
 * brew: librsvg (OSX)
If librsvg-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a librsvg-2.0.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 ‘rsvg’
* removing ‘/usr/local/lib/R/site-library/rsvg’
################################### End Log ################################### 
Error: Unhandled Exception: Child Task 176819728 failed: Error building image: Error building rsvg (0.5). Build exited with non-zero status: 1

Note, on my system (Debian) where the app runs I do have librsvg2-dev installed.  Also, if I pull the DiagrammeR package from CRAN (version 0.8.2), which doesn't import the rsvg package, then everything runs fine.  DiagrammeR from GitHub requires the CRAN package rsvg (version 0.5).

Tareef Kawaf

unread,
Mar 31, 2016, 8:36:31 AM3/31/16
to Matt Brigida, ShinyApps Users
Matt,
Do you actually have the devtools::install_github at the top of your file?  You should only need to have the library calls in there, shinyapps.io will take care of installing the packages itself.
-Tareef

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/b05b4f26-5190-4e92-b4b3-37d077cc4f5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Brigida

unread,
Mar 31, 2016, 11:33:23 AM3/31/16
to ShinyApps Users, mdbr...@gmail.com
Tareef,

Regardless, it seems the build is failing on the CRAN version of rsvg.  To confirm I created a new presentation (see below) with one app which only calls 

library(rsvg)

and then plots a random number.  The presentation works on my system with librsvg2-dev installed.  The build on shinyapps.io again fails on rsvg with the same error message. So it seems shinyapps.io servers don't have the necessary libraries to build rsvg from CRAN.  Is it possible to have the library installed?  

Note, the newer version of DiagrammeR on github has important fixes I need.  So I can't use the CRAN version which shinyapps.io pulls -- hence the github version.

Thanks for your help.

Matt

Try to push the following to shinyapps.io and you should see the error:

---                                                                                                          
title
: "Example rsvg"                                                                                        
author
: ""                                                                                                    
affiliation
:                                                                                                  
date
: "03/02/2016"                                                                                            
output
: ioslides_presentation                                                                                
runtime
: shiny                                                                                                
smaller
: true                                                                                                
---                                                                                                          
                                                                                                             
## Shiny App                                                                                                  
                                                                                                             
```{r, echo=FALSE, message=FALSE, warning=FALSE}                                                              
library(rsvg)                                                                                                
inputPanel(                                                                                                  
   )                                                                                                          
renderPlot({                                                                                                  
  plot(rnorm(1))                                                                                              
})                                                                                                            
```
   

Andy Kipp

unread,
Mar 31, 2016, 12:05:15 PM3/31/16
to Matt Brigida, ShinyApps Users
Matt,

You are correct: librsvg is not installed. You can file a ticket here: https://github.com/rstudio/shinyapps-package-dependencies about adding librsvg2 for rsvg. 

If you're feeling motivated, you can also send a PR.

-Andy

Tareef Kawaf

unread,
Mar 31, 2016, 2:03:54 PM3/31/16
to Matt Brigida, ShinyApps Users
Hi Matt,
Josh tells me the new version of the package has a new dependency on the OS level.  We have added it to the backlog and will get it in there first thing next week.
-Tareef

On Thu, Mar 31, 2016 at 11:33 AM, Matt Brigida <mdbr...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages