【发布时间】:2014-10-31 09:16:19
【问题描述】:
我正在使用 perl-cgi 调用
my $call = qx(Rscript tcga_analysis.R $bg_name $ctr_name $set $user);
当我在服务器上使用来自 unix 的 Rscript myRscript.R 时,它可以工作,但从 perl 中我似乎无法加载任何包。我收到以下错误(来自 Apache 日志):
Error in library(gplots) : there is no package called 'gplots'
使用 .libPaths():
> .libPaths()
[1] "/home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1"
[2] "/usr/lib64/R/library"
[3] "/usr/share/R/library"
在主文件夹中显示我的个人图书馆。
我尝试过使用
library(gplots, lib.loc="/home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1")
但我收到lib.loc error 说那里没有图书馆树。
我什至在包含库路径的工作目录中创建了一个.Rprofile 文件,但没有成功。我也尝试添加pos=1,但没有成功...
但是,如果我打开 R 并调用 library(gplots) 它可以工作
我需要让它从 perl 调用 Rscript,因为它是分析管道的一部分,它使用 Web 界面 -> perl-cgi -> R 来分析一些数据!
谢谢:)
【问题讨论】:
-
cgi 脚本是否由其他用户运行,可能是 apache?可能是权限问题。
-
我是包含 R 和 perl cgi 脚本的 var/www/html 文件夹的所有者
-
R 库的权限似乎是个问题。试试
chmod -R a+r /home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1,即让任何人都可以阅读所有内容。 -
@flodel 刚试过,日志上同样的错误:
Error in library(gplots) : there is no package called 'gplots' -
能否提供以自己身份运行
ls -ld /home/sbattaglia/R/x86_64-redhat-linux-gnu-library/3.1/gplots的输出?