Shiny deploy error: unable to load shared object

Hi all,

When I deploy a shiny app via RStudio. I had the error below. It shows unable to load shared object. This is my first time to deploy a shiny app. I have no idea of how to fix it. Can anyone provide some hint? Thank you!

[2018-07-04T04:28:38.351794583+0000] Installing R package: DOSE (3.6.1)

  • installing to library ‘/opt/R/3.5.0/lib/R/library’
  • installing binary package ‘DOSE’ ...
  • DONE (DOSE)
    [2018-07-04T04:28:38.777992539+0000] Building R package: enrichplot (1.0.2)
    /mnt/packages/build /mnt
  • installing to library ‘/opt/R/3.5.0/lib/R/library’
  • installing source package ‘enrichplot’ ...
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in dyn.load(file, DLLpath = DLLpath, ...) :
    unable to load shared object '/opt/R/3.5.0/lib/R/library/units/libs/units.so':
    libudunits2.so.0: cannot open shared object file: No such file or directory
    ERROR: lazy loading failed for package ‘enrichplot’
  • removing ‘/opt/R/3.5.0/lib/R/library/enrichplot’
    ################################# End Task Log #################################
    Error: Unhandled Exception: Child Task 535316378 failed: Error building image: Error building enrichplot (1.0.2). Build exited with non-zero status: 1
    Execution halted

As Josh has already responded to this here:
https://groups.google.com/forum/#!msg/shinyapps-users/GO1sAUZ537w/ZjbLK7UlAgAJ
Could you please mark this as resolved and/or remove this to ensure that there's no unnecessary duplication of effort?

Also, please see our FAQ around cross-posting:

Sorry about the cross-posing. I have marked this as resolved. I will be more careful next time. Thank you.