This might be discussed before. But, I cannot find the solution for my specific trouble.
I was trying to run a shiny app on EC2, but failed to render plots due to the failure to start a PNG device obviously. My R version is 3.5.1, Ubuntu version is 16.04. The error msg is like:
Warning in pngfun(filename = filename, width = width, height = height, res = res, :
unable to open connection to X11 display ''
Warning: Error in .External2: unable to start device PNG
123: pngfun
122: startPNG
121: drawPlot
107: <reactive:plotObj>
91: drawReactive
78: origRenderFunc
77: output$umi_cell_ranking
1: runApp
How did you install that R version? I had same issues with wget and config/make from source. If you update your keys and install the r-base 3.4, it worked for me
Hi Vinnyp90, I did the same thing as you, install 3.5.1 from source. Glad to hear downgrade R solve the problem, but the pipeline I am building recommends 3.5 version. I don't have the problem on my local MAC with binary version of R3.5. It might be sth wrong from compiling R 3.5 source. Not sure.
Do you mind sharing the commands you are executing to build R from source? Do you have the history of commands, or the list of all dependencies you have added to the server? I'm wondering if you are missing some system dependency or something. capabilities() thinks you have what you need, though...
Also, what happens if you execute something simple like
$ ./configure \
--prefix=/opt/R/$(cat VERSION) \
--enable-memory-profiling \
--enable-R-shlib \
--with-blas \
--with-lapack
$ make
$ sudo make install
If you want to try compiling fresh, you could do that. Or you could list the system dependencies you have installed with
apt list --installed
This would at least allow those of us with working systems to see if you're missing one!
EDIT: Looking at your capabilities a bit closer, you are missing cairo, which could be problematic. I think you can install it with apt-get install -y libcairo2-dev? And then you will need to rebuild R.
Hi Cole
Thank you so much for the help. I followed your suggestions in the above post and still got bad luck (same error, cannot start device PNG). I tried to generate the png file in R, it works fine. I cannot attach with the post as a new user. Sorry, but do you have a personal email for me to send the apt list?
Very strange! What if you try to recompile R from source, and add the --with-cairo option (or whatever the syntax is)? Before you make and make install, you should see whether the cairo capability is set up appropriately (it prints right at the end of the configure command).