I'm trying to publish a sample Shiny app from RStudio Server to a new RStudio Connect server. The app works fine in the IDE but when launching it on Connect the UI controls are visible and functional but the plot does not, and the following error appears.
An error has occurred. Check your logs or contact the app author for clarification.
I found that the R option for bitmapType on the RStudio Server was set to "cairo" but on the RStudio Connect server it was set to "xlib" even though R was configured without X11 support.
R was installed via yum on the RStudio Server and from source on the RStudio Connect server.
Is there a better way to do this? And change the option server-wide?
We recommend that you install R from source, both for RStudio Connect and RStudio Server Pro. This is the only way to be sure your code will run on the version of R you intended, rather than the system R (provided by yum).
Since you have already built R from source on this machine, it may be as simple as changing the RStudio Server config file to point to the location where you installed R (from source).
See the admin guide Section 6 R versions for instructions. Specifically, you can define the installed versions in the file /etc/rstudio/r-versions, as described in Section 6.4.1. For example:
The devices based on cairographics (svg, cairo_pdf, cairo_ps and the type = "cairo" versions of png, jpeg, tiff and bmp) are implemented in a separate DLL winCairo.dll which is loaded when one of these devices is first used. It is not built by default, and needs to be built (after make all) by make cairodevices.
To enable the building of these devices you need to install the static cairographics libraries built by Simon Urbanek at https://www.rforge.net/Cairo/files/cairo-current-win.tar.gz. Set the macro ‘CAIRO_HOME’ in MkRules.local. (Note that this tarball unpacks with a top-level directory src/: ‘CAIRO_HOME’ needs to include that directory in its path.)
I hope these instructions help to resolve your problem.