Rsudio service

这篇博客记录了RStudio Server的安装验证、启动、停止及重启过程,并着重解决了配置文件中`rsession-which-r`参数错误及R环境问题。在尝试解决R包加载失败的问题时,调整了`.libPaths()`的路径,但遇到了动态链接库错误,最终通过安装缺失的库文件解决了问题。
摘要由CSDN通过智能技术生成

Rsudio service

Server Configuration File

www-port=8888

rsesssion-which-r=/opt/conda/envs/R7/bin/R
www-port=8888

(base) root@0b5003cae16c:/etc/rstudio# sudo rstudio-server verify-installation
Server is running and must be stopped before running verify-installation
(base) root@0b5003cae16c:/etc/rstudio#

(DEP_shiny) root@0b5003cae16c:/etc/rstudio# sudo rstudio-server verify-installation
Server is running and must be stopped before running verify-installation
(DEP_shiny) root@0b5003cae16c:/etc/rstudio#

sudo rstudio-server verify-installation #查看安装是否正常
sudo rstudio-server start #启动RStudio-server
sudo rstudio-server status #查看RStudio-server
sudo rstudio-server stop #关闭RStudio-server
sudo rstudio-server verify-installation #查看安装是否正常
sudo rstudio-server start #启动RStudio-server
sudo rstudio-server status #查看RStudio-server
sudo rstudio-server stop #关闭RStudio-server
sudo rstudio-server restart #重启RStudio-server #重启RStudio-server

ps -aux

yyp@0b5003cae16c:/etc/rstudio$ sudo rstudio-server verify-installation
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/var/log/rstudio/rstudio-server/rserver.log’.
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/tmp/381e-a7ca-1579-481b/.local/share/rstudio/log/rsession-rstudio-server.log’.
2022-11-14T02:38:17.851120Z [rsession-rstudio-server] WARNING Unable to determine LANG (proceeding with no LANG set; LOGGED FROM: void rstudio::core::r_util::ensureLang() src/cpp/core/r_util/REnvironmentPosix.cpp:1000
Error reading /etc/rstudio/rsession.conf: unrecognised option ‘rsesssion-which-r’【这里打错字了!!!!多了一个s】
yyp@0b5003cae16c:/etc/rstudio$

(DEP_shiny) root@0b5003cae16c:/etc/rstudio# sudo rstudio-server verify-installation
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/var/log/rstudio/rstudio-server/rserver.log’.
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/tmp/3fde-983b-9ffe-3cda/.local/share/rstudio/log/rsession-rstudio-server.log’.
2022-11-14T02:40:09.835660Z [rsession-rstudio-server] WARNING Unable to determine LANG (proceeding with no LANG set; LOGGED FROM: void rstudio::core::r_util::ensureLang() src/cpp/core/r_util/REnvironmentPosix.cpp:1000
(DEP_shiny) root@0b5003cae16c:/etc/rstudio# su yyp
yyp@0b5003cae16c:/etc/rstudio$ sudo rstudio-server verify-installation
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/var/log/rstudio/rstudio-server/rserver.log’.
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from ‘/etc/rstudio/logging.conf’. Logging to ‘/tmp/64f2-f01c-76ed-4118/.local/share/rstudio/log/rsession-rstudio-server.log’.
2022-11-14T02:40:33.401212Z [rsession-rstudio-server] WARNING Unable to determine LANG (proceeding with no LANG set; LOGGED FROM: void rstudio::core::r_util::ensureLang() src/cpp/core/r_util/REnvironmentPosix.cpp:1000
yyp@0b5003cae16c:/etc/rstudio$

R version 4.2.2 Patched (2022-11-10 r83330) – “Innocent and Trusting”
Copyright © 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

library(dior)
Error in library(dior) : there is no package called ‘dior’
library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

#######成功解决问题 但是R的环境 配置错误 不是conda 中的

yyp@0b5003cae16c:/etc/rstudio$ ls
database.conf fonts rserver.conf rsession.conf themes
yyp@0b5003cae16c:/etc/rstudio$ cat rserver.conf

Server Configuration File

rsession-which-r=/opt/conda/envs/R7/bin/R

www-port=8888

yyp@0b5003cae16c:/etc/rstudio$ cat rsession.conf

R Session Configuration File

rsession-which-r=/opt/conda/envs/R7/bin/R

rsession-which-r=/opt/conda/envs/R7/bin/R

www-port=8888
yyp@0b5003cae16c:/etc/rstudio$

rsession-which-r=
rsession-which-r
/etc/rstudio/rsession.conf

yyp@0b5003cae16c:/etc/rstudio$ cat /etc/rstudio/rsession.conf

R Session Configuration File

rsesssion-which-r=/opt/conda/envs/R7/bin/R

#rsession-which-r=/opt/conda/envs/R7/bin/R
www-port=8888

yyp@0b5003cae16c:/etc/rstudio$ ######yyp的用户没法用 root?

library(dior)
Error: package or namespace load failed for ‘dior’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/home/yyp/R/x86_64-pc-linux-gnu-library/4.2/rlang/libs/rlang.so’:
/home/yyp/R/x86_64-pc-linux-gnu-library/4.2/rlang/libs/rlang.so: undefined symbol: EXTPTR_PROT
In addition: Warning message:
Character set is not UTF-8; please change your locale

、在rstudio窗口,查看库文件的路径

.libPaths()
[1] “/home/enn_james/R/x86_64-unknown-linux-gnu-library/3.2” "/usr/local/lib64

Rprofile.site

.libPaths(c(‘D:/R/R-3.6.2/library’, ‘D:/rwork/R/win-library/3.6’, .libPaths()))

增加包的路径

.libPaths( c( .libPaths(), “~/userLibrary”) )

.libPaths()
[1] “/home/yyp/R/x86_64-pc-linux-gnu-library/4.2” “/opt/conda/envs/R6/lib/R/library”

.libPaths()
[1] “/home/yyp/R/x86_64-pc-linux-gnu-library/4.2” “/opt/conda/envs/R6/lib/R/library”
library(dior)
Error: package or namespace load failed for ‘dior’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/home/yyp/R/x86_64-pc-linux-gnu-library/4.2/rlang/libs/rlang.so’:
/home/yyp/R/x86_64-pc-linux-gnu-library/4.2/rlang/libs/rlang.so: undefined symbol: EXTPTR_PROT

.libPaths(c(‘/opt/conda/envs/R6/lib/R/library’, ‘/opt/conda/envs/R6/lib/R/library’, .libPaths()))

.libPaths(c(‘/opt/conda/envs/R6/lib/R/library’, ‘/opt/conda/envs/R6/lib/R/library’, .libPaths()))
.libPaths()
[1] “/opt/conda/envs/R6/lib/R/library” “/home/yyp/R/x86_64-pc-linux-gnu-library/4.2”

######本地是

library(dior)
.libPaths()
[1] “/opt/conda/envs/R6/lib/R/library”

.libPaths()
[1] “/opt/conda/envs/R6/lib/R/library” “/home/yyp/R/x86_64-pc-linux-gnu-library/4.2”

library(dior)
Error: package or namespace load failed for ‘dior’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/opt/conda/envs/R6/lib/R/library/igraph/libs/igraph.so’:
libglpk.so.40: cannot open shared object file: No such file or directory

apt-get install libglpk40

(R6) root@0b5003cae16c:/opt/conda/envs/R6/lib/R/library/igraph/libs# ls
igraph.so
(R6) root@0b5003cae16c:/opt/conda/envs/R6/lib/R/library/igraph/libs#

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值