yihui
您好,我写了一个shiny应用,是使用RODBC读MYSQL数据库,在本地Windows上运行都没有问题,不过放到服务器上会报错,错误是:
Warning: Error in gsub: input string 4 is invalid in this locale
我的服务器系统是:
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS release 6.8 (Final)
Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=zh_CN.utf8 LC_NUMERIC=C
[3] LC_TIME=zh_CN.utf8 LC_COLLATE=zh_CN.utf8
[5] LC_MONETARY=zh_CN.utf8 LC_MESSAGES=zh_CN.utf8
[7] LC_PAPER=zh_CN.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=zh_CN.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.1
我在我写的shinyAPP里加上您下面这段话,不过仍然是报错:
options(shiny.usecairo = FALSE)
font_home <- function(path = '') file.path('~', '.fonts', path)
if (Sys.info()[['sysname']] == 'Linux') {
dir.create(font_home())
file.copy('wqy-zenhei.ttc', font_home())
system2('fc-cache', paste('-f', font_home()))
}
期待您的答复~