代码之家  ›  专栏  ›  技术社区  ›  Abdelmoamen

shiny应用程序可以在本地运行,但不能在shinyapps上运行。io

  •  0
  • Abdelmoamen  · 技术社区  · 7 年前

    我用sql server连接创建了这个应用程序,它在我的设备上正常工作,但发布后出现了这个错误 应用程序无法启动 这是我在这个错误页面中得到的:

        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
    

    我的代码将在这里: my app code

    1 回复  |  直到 6 年前
        1
  •  0
  •   Abdelmoamen    7 年前

    我通过使用解决了这个问题 数据库连接(&C);DBI公司 库而不是 RODBC 和使用 RSQLServer::SQLServer() 打开sql server上的连接。我感谢@PorkChop在这方面给我的帮助。