【发布时间】:2014-01-26 12:08:58
【问题描述】:
我正在尝试在我的本地 Ubuntu 12.04 机器上安装 R Shiny 服务器,并按照此处的说明进行操作 https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions:
当尝试做一个:
install.packages('shiny', repos='http://cran.rstudio.com/')
它通过依赖关系,但无法安装 Rcpp。请参阅下面的错误日志:
* installing *source* package 'Rcpp' ...
* package 'Rcpp' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Date.cpp -o Date.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Module.cpp -o Module.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Rcpp_init.c -o Rcpp_init.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Timer.cpp -o Timer.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c api.cpp -o api.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c attributes.cpp -o attributes.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c barrier.cpp -o barrier.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c exceptions.cpp -o exceptions.o
g++ -shared -o Rcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -L/usr/lib/R/lib -lR
g++ -o libRcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -shared -L/usr/lib/R/lib -lR
ar qc libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o
cp libRcpp.so ../inst/lib
cp libRcpp.a ../inst/lib
rm libRcpp.so libRcpp.a
installing to /usr/local/lib/R/site-library/Rcpp/libs
* R
* inst
* preparing package for lazy loading
Error : package 'codetools' was built before R 3.0.0: please re-install it
Error : unable to load R code in package 'Rcpp'
ERROR: lazy loading failed for package 'Rcpp'
* removing '/usr/local/lib/R/site-library/Rcpp'
* installing *source* package 'httpuv' ...
* package 'httpuv' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I./libuv/include -I./http-parser -I./sha1 -I./base64 -I"/usr/lib/R/site-library/Rcpp/include" -fpic -O3 -pipe -g -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:75:10: error: 'uint32_t' was not declared in this scope
RcppExports.cpp: In function 'SEXPREC* httpuv_run(SEXP)':
RcppExports.cpp:79:5: error: 'uint32_t' was not declared in this scope
RcppExports.cpp:79:14: error: expected ';' before 'timeoutMillis'
RcppExports.cpp:80:25: error: 'timeoutMillis' was not declared in this scope
RcppExports.cpp:80:38: error: 'run' cannot be used as a function
make: * [RcppExports.o] Error 1
ERROR: compilation failed for package 'httpuv'
* removing '/usr/local/lib/R/site-library/httpuv'
ERROR: dependency 'httpuv' is not available for package 'shiny'
* removing '/usr/local/lib/R/site-library/shiny'
编辑:
手动下载和安装 Rcpp 给了我:
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Error : package 'codetools' was built before R 3.0.0: please re-install it
于是我手动下载并安装了codetools并重新尝试了Rcpp:
sudo R CMD INSTALL codetools_0.2-8.tar.gz
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
然后再次按照“安装 R”和“安装闪亮”的 Shiny 网页中的说明进行操作,得到了类似的错误,但现在出现了 caTools、bitops 和 xtable,所以我手动安装了每个其中。闪亮的安装正确。
然后按照说明中的后续步骤进行操作。
任何想法为什么我得到这个“在 R 3.0.0 之前构建”错误?
【问题讨论】:
-
在安装失败之前
Rcpp有一行:Error : package 'codetools' was built before R 3.0.0: please re-install it。尝试运行update.packages("codetools"),然后安装 Shiny -
如何重新安装软件包?
update.packages(codetools)不这样做:> update.packages("codetools") > library(codetools) Error: package ‘codetools’ was built before R 3.0.0: please re-install it > update.packages("codetools") -
希望您注意到您提到的页面顶部的重定向。该页面已过时;新说明在这里:rstudio.com/shiny/server/install-opensource
标签: r ubuntu-12.04 shiny rcpp shiny-server