19

Previously I have been able to start Rserve from the command line via:

R CMD Rserve

After upgrading to 3.0.2 on Ubuntu, I get:

/usr/lib/R/bin/Rcmd: 62: exec: Rserve: not found

I've tried reinstalling and launching manually via

R
> install.packages('rserve')
> ...compiles successfully...
> RServe()
Starting Rserve:
 /usr/lib/R/bin/R CMD /home/user1/R/x86_64-pc-linux-gnu-library/3.0/Rserve/libs//Rserve

...which works fine.

R CMD Rserve still fails with the same error as above. I've tried specifying the path via:

export RHOME="/home/jwiley/R/x86_64-pc-linux-gnu-library/3.0/Rserve/libs/"
export R_LIBS="/home/jwiley/R/x86_64-pc-linux-gnu-library/3.0/Rserve/libs/"

How can I convince R CMD to use the correct directory?

Allyl Isocyanate
  • 13,306
  • 17
  • 79
  • 130
  • To understand your problem better, please try following in your bash (wich command): which R and wich Rserve – Mirko Ebert May 05 '15 at 12:28
  • Is it possible that your library is not loaded when you start R? Does it work if you add the `library("Rserve")` to your .Rprofile ? – Prolix Jun 11 '15 at 16:50

3 Answers3

8

In my case this was the fix (after installing Rserve):

cd /usr/lib/R/bin
ln -s /usr/lib/R/site-library/Rserve/libs/Rserve Rserve

This fixed the problem on Ubuntu 14.04 (LTS)

R library location may vary, actual path to Rserve can be checked from R:

system.file("libs", "Rserve", package="Rserve")
jangorecki
  • 16,384
  • 4
  • 79
  • 160
wlk
  • 5,695
  • 6
  • 54
  • 72
3

While starting Rserve as a daemon process from terminal in ubuntu 16.04 I got the same issue.

Commands to fix.

apt-cache policy r-cran-rserve
sudo apt-get install r-cran-rserve
Sijo Jose
  • 41
  • 4
2

Commands to fix:

cd /usr/lib/R/bin/
ln -sf ../site-library/Rserve/libs/Rserv
ln -sf ../site-library/Rserve/libs/Rserve.db
jangorecki
  • 16,384
  • 4
  • 79
  • 160
Kartikey Tanna
  • 1,423
  • 10
  • 24