RHEL7.8 error while loading shared libraries: libR.so

When trying to install RStudio Server Pro, the following error is encountered when checking sudo rstudio-server verify-installation:

/usr/lib/rstudio-server/bin/rsession: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory

Why am I seeing this error and how can I overcome it?

Here are the steps taken to install R and RServer Pro:

R Installation:

yum update -y
yum install -y wget curl
cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y epel/epel-release-latest-7.noarch.rpm
sed -i '70s/0/1/' /etc/yum.repos.d/redhat-rhui.repo
yum-builddep R -y
cd /usr/local/src
wget https://cran.r-project.org/src/base/R-3/R-3.6.1.tar.gz
tar -xzvf R-3.6.1.tar.gz
cd /usr/local/src/R-3.6.1
/usr/local/src/R-3.6.1/configure --prefix=/opt/R/$(cat VERSION) --enable-memory-profiling --enable-R-shlib --with-blas --with-cairo=yes --with-lapack --with-libpng=yes --with-x
yum install -y java-1.8.0-openjdk-devel openssl-devel
make
make
make install
/opt/R/3.6.1/bin/R --version

RStudio Server Pro Installation:

curl -O https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-pro-1.2.5033-1-x86_64.rpm
yum install -y rstudio-server-rhel-pro-1.2.5033-1-x86_64.rpm
ln -sf /opt/R/3.6.1/bin/R /usr/bin/R
sudo yum install firewalld -y
systemctl start firewalld
sudo systemctl enable firewalld
firewall-cmd --zone=public --add-port=8787/tcp --permanent
firewall-cmd --reload
sudo rstudio-server start
sudo rstudio-server status

Welcome and thanks for trying out RStudio Server Pro!

I don't see any obvious errors in your commands, but it appears that RStudio Server Pro is not picking up everything that it needs to know about your installation of R and its associated libraries. Here are some things that you can try:

  1. I recommend using our precompiled binaries for R, restart RStudio Server Pro, and see if that fixes the issue: https://docs.rstudio.com/resources/install-r/

  2. RStudio Server Pro scans for versions of R in some default locations, but you can also configure specific locations and defaults: https://docs.rstudio.com/ide/server-pro/r-versions.html#configuring-the-default-version-of-r

  3. If you need to proceed by installing R from source, follow our documented steps to see if it works in your environment: https://docs.rstudio.com/resources/install-r-source/

The issue was due to installing R from source. When installing from pre-compiled libraries I encountered no issues. I did have to reset the machine - as I was having issues even with the binaries after doing by source first.

Thanks @koverholt

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.