16

I need to install rvest package for R version 3.1.2 (2014-10-31)

I get these errors:

    checking whether the C++ compiler supports the long long type... no
*** stringi cannot be built. Upgrade your C++ compiler's settings
ERROR: configuration failed for package ‘stringi’
* removing ‘/usr/local/lib64/R/library/stringi’
ERROR: dependency ‘stringi’ is not available for package ‘stringr’
* removing ‘/usr/local/lib64/R/library/stringr’
ERROR: dependency ‘stringr’ is not available for package ‘httr’
* removing ‘/usr/local/lib64/R/library/httr’
ERROR: dependency ‘stringr’ is not available for package ‘selectr’
* removing ‘/usr/local/lib64/R/library/selectr’
ERROR: dependencies ‘httr’, ‘selectr’ are not available for package ‘rvest’
* removing ‘/usr/local/lib64/R/library/rvest’

Any ideas on how I could install R package rvest?

JJJ
  • 939
  • 6
  • 17
  • 28
user1471980
  • 10,321
  • 41
  • 125
  • 218
  • 1
    are you installing from CRAN? What was the command you used? – jeremycg Jun 23 '15 at 16:59
  • 1
    install.packages("rvest") – user1471980 Jun 23 '15 at 17:07
  • did you try updating whether `the C++ compiler supports the long long type`? – Aaron Katch Jun 23 '15 at 17:20
  • @AaronKatch, I am not sure how to do that – user1471980 Jun 23 '15 at 17:31
  • Since you are using an out-of-date version of R, you will need to be compiling from package versions that match the old version and you will need to be using development versions of R and supporting tools since the headers are sometimes missing in the base distributions. – IRTFM Jun 23 '15 at 17:35
  • @BondedDust, I cannot upgurade R. My R version is not that old. I just tried to install stringi from the source, still gives me that c++ long type error. How do I get around it, any ideas? – user1471980 Jun 23 '15 at 17:49
  • I gave you "ideas". Use the development version of R and make sure all the toolchain and package versions (all of them that are needed for installation and runs) match the version you are using. – IRTFM Jun 23 '15 at 17:55

4 Answers4

33

My system is Ubuntu 14.04 with R:3.2.3, and I had the same problem.

Then I checked err meg and tried to install library of libcurl4-openssl-dev and libxml2-dev:

sudo apt-get install libcurl4-openssl-dev

sudo apt-get install libxml2-dev

After installed, install.packages("rvest") was successful.

Jilber Urbina
  • 50,760
  • 8
  • 101
  • 127
NoahC
  • 439
  • 4
  • 4
9

I needed dependencies such as Rcurl, XML, rvest, xml2, when I was trying to install tidyverse, DESeq2, RUVSeq in Rstudio Version 1.1.456 on a fresh installed Ubuntu 18.04. Anyway, there were a bunch of missing dependencies. This answer might fit better as a comment for Ubuntu 18.04, but I don't have that many reputation. So just trying to make a summary of solutions works for Ubuntu 18.04 here.
In the terminal, run:

 sudo apt-get install libcurl4-openssl-dev libssl-dev
 sudo apt-get install libxml2-dev

Then within Rstudio,

install.packages("xml2")
install.packages("rvest")
install.packages("tidyverse")  # might need other dependencies installed in Rstudio

Got tidyverse!
In the terminal:

sudo apt-get install libmysqlclient-dev  ## for RMySQL

Then within the Rstudio

source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
biocLite('RUVSeq')             ## might have messages as following

installation path not writeable, unable to update packages: cluster, foreign, MASS, Matrix, mgcv, nlme, survival

In the terminal:

sudo R                      ## give R the root permission
## in the R session within the terminal
pks <- c('cluster', 'foreign', 'MASS', 'Matrix', 'mgcv', 'nlme', 'survival')
install.packages(pks)
q()

That's my own experience. Hope this one has a good Generalizability.

Guannan Shen
  • 469
  • 6
  • 5
2

I was able to build the stringi package as this:

install.packages('stringi', configure.args='--disable-cxx11')
user1471980
  • 10,321
  • 41
  • 125
  • 218
0

My answer is definitely late to this question. Nevertheless, somebody may find it useful.

I run into the same problem so I run this command on the shell:

sudo apt-get upgrade pkg-config

It worked for me.