闪亮的应用程序可以在本地运行,但不能在 shinyapps.io 上运行

shiny app works locally, but not on shinyapps.io

我已经使用 sql 服务器连接创建了这个应用程序并且它在我的设备上正常工作但是在发布它之后我得到了这个错误 应用程序无法启动 和这个是我在这个错误页面中得到的:

    Attaching package: ‘rsconnect’

The following object is masked from ‘package:shiny’:

    serverInfo


Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union


Attaching package: ‘RODBCext’

The following objects are masked from ‘package:RODBC’:

    odbcFetchRows, sqlFetchMore


Attaching package: ‘shinydashboard’

The following object is masked from ‘package:graphics’:

    box

Warning in odbcDriverConnect("driver={SQL Server};server=************;database=*******;uid=****;pwd=*****") :
  [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified
Warning in odbcDriverConnect("driver={SQL Server};server=************\.,1435;database=************;uid=****;pwd=****") :
  ODBC connection failed
Error in value[[3L]](cond) : first argument is not an open RODBC channel
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

我的代码将在这里:

我通过使用 dbConnect & DBI 库而不是 RODBC 并使用 RSQLServer::SQLServer() 打开 sql 上的连接解决了这个问题服务器。我感谢@PorkChop 在这方面给我的帮助。