Issue with my shiny app

Hi all,


I have issues with my shiny app, the app is working perfectly on my local computer but not working when deployed on shinyapps.io. Below is the error message that is showing on shinyapps.io

I have images of the error attached.

Error: An error has occurred. Check your logs or contact the app author for clarification.

Hi, welcome!

We don't have enough information to help you out, Could you check what your app's logs say?

Thank you for the reply to my message.
Below is the message i got from the log:

2020-05-19T01:42:35.791569+00:00 shinyapps[2313872]:     6: eval
2020-05-19T01:42:35.791569+00:00 shinyapps[2313872]:     5: eval
2020-05-19T01:42:35.791567+00:00 shinyapps[2313872]:    12: fn
2020-05-19T01:42:35.791568+00:00 shinyapps[2313872]:     7: connect$retry
2020-05-19T01:55:11.466429+00:00 shinyapps[2313872]: Warning: namespace ‘kernlab’ is not available and has been replaced
2020-05-19T01:55:11.466431+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘svm’
2020-05-19T01:55:13.209233+00:00 shinyapps[2313872]: Warning: namespace ‘modeltools’ is not available and has been replaced
2020-05-19T01:55:13.209236+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘stock_tree2’
2020-05-19T01:55:13.210017+00:00 shinyapps[2313872]: Warning: namespace ‘party’ is not available and has been replaced
2020-05-19T01:55:13.210019+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘stock_tree2’
2020-05-19T01:55:13.231449+00:00 shinyapps[2313872]: Warning: namespace ‘plumber’ is not available and has been replaced
2020-05-19T01:55:13.231451+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘r’
2020-05-19T01:55:13.242725+00:00 shinyapps[2313872]: Attempting to load the environment ‘package:stats’
2020-05-19T01:55:13.593888+00:00 shinyapps[2313872]: Warning: namespace ‘xgboost’ is not available and has been replaced
2020-05-19T01:55:13.593890+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘fit_xgb’
2020-05-19T01:55:14.735179+00:00 shinyapps[2313872]: Warning: namespace ‘knitr’ is not available and has been replaced
2020-05-19T01:55:14.735181+00:00 shinyapps[2313872]: by .GlobalEnv when processing object ‘pr’
2020-05-19T01:55:15.484264+00:00 shinyapps[2313872]: Server version: 1.8.2-10
2020-05-19T01:55:15.484265+00:00 shinyapps[2313872]: LANG: en_US.UTF-8
2020-05-19T01:55:15.484281+00:00 shinyapps[2313872]: shiny version: 1.4.0.2
2020-05-19T01:55:15.484281+00:00 shinyapps[2313872]: R version: 3.6.1
2020-05-19T01:55:15.484281+00:00 shinyapps[2313872]: httpuv version: 1.5.2
2020-05-19T01:55:15.484298+00:00 shinyapps[2313872]: knitr version: (none)
2020-05-19T01:55:15.484298+00:00 shinyapps[2313872]: jsonlite version: 1.6.1
2020-05-19T01:55:15.484298+00:00 shinyapps[2313872]: RJSONIO version: (none)
2020-05-19T01:55:15.484281+00:00 shinyapps[2313872]: rmarkdown version: (none)
2020-05-19T01:55:15.558349+00:00 shinyapps[2313872]: Starting R with process ID: '25'
2020-05-19T01:55:15.572049+00:00 shinyapps[2313872]: Loading required package: lattice
2020-05-19T01:55:15.484305+00:00 shinyapps[2313872]: htmltools version: 0.4.0
2020-05-19T01:55:15.484474+00:00 shinyapps[2313872]: Using pandoc: /opt/connect/ext/pandoc2
2020-05-19T01:55:15.551384+00:00 shinyapps[2313872]: Using jsonlite for JSON processing
2020-05-19T01:55:15.558348+00:00 shinyapps[2313872]: 
2020-05-19T01:55:15.579052+00:00 shinyapps[2313872]: Loading required package: ggplot2
2020-05-19T01:55:15.739999+00:00 shinyapps[2313872]: 
2020-05-19T01:55:15.740000+00:00 shinyapps[2313872]: Listening on http://127.0.0.1:35464
2020-05-19T01:55:26.602817+00:00 shinyapps[2313872]: Warning: Error in : Required package is missing
2020-05-19T01:55:26.609989+00:00 shinyapps[2313872]:   134: stop
2020-05-19T01:55:26.609990+00:00 shinyapps[2313872]:   133: checkInstall
2020-05-19T01:55:26.609991+00:00 shinyapps[2313872]:   132: train.default
2020-05-19T01:55:26.609991+00:00 shinyapps[2313872]:   130: train.formula
2020-05-19T01:55:26.609992+00:00 shinyapps[2313872]:   128: <reactive:lm_model> [/srv/connect/apps/LoanRiskPredictor/app.R#142]
2020-05-19T01:55:26.609992+00:00 shinyapps[2313872]:   112: lm_model
2020-05-19T01:55:26.609993+00:00 shinyapps[2313872]:    93: output$prediction_output
2020-05-19T01:55:26.609992+00:00 shinyapps[2313872]:   111: renderPrint [/srv/connect/apps/LoanRiskPredictor/app.R#166]
2020-05-19T01:55:26.609993+00:00 shinyapps[2313872]:   110: func
2020-05-19T01:55:26.609993+00:00 shinyapps[2313872]:    94: origRenderFunc
2020-05-19T01:55:26.610004+00:00 shinyapps[2313872]:     7: connect$retry
2020-05-19T01:55:26.609994+00:00 shinyapps[2313872]:    13: runApp
2020-05-19T01:55:26.610004+00:00 shinyapps[2313872]:    12: fn
2020-05-19T01:55:26.610004+00:00 shinyapps[2313872]:     6: eval
2020-05-19T01:55:26.610005+00:00 shinyapps[2313872]:     5: eval

I think the error message is pretty informative — the packages that you need are not installed on shinyapps. You'll need to figure out why not they're not being picked up when you deploy to shiny apps. Are you loading them in some non-standard way?