5

I am trying to start Rserve using Rserve() command in R console but I am getting an error as /Library/Frameworks/R.framework/Resources/bin/R: line 141: exec: sh: not found

I have Mac OSX Maverick. I installed R version 3.1.0. After this I tried to install Rserve using command install.packages("Rserve") after which in red color the message displayed was

trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/Rserve_1.7-3.tgz'
Content type 'application/x-gzip' length 329829 bytes (322 Kb)
opened URL
==================================================
downloaded 322 Kb

After this I gave command library(Rserve) in R console and no error came but then when I gave command Rserve() to start the server I got the error which I have mentioned above.

I am unable to understand why this error is coming. Is it because Rserve is not installed successfully? How else the Rserve can be installed? I tried to install Rserve through source package also. I downloaded the source package from rforge website and when I gave the command install.packages("Rserve", type = "source") I got the error as: installation of package ‘Rserve’ had non-zero exit status

Any help will be great!

user2966197
  • 2,793
  • 10
  • 45
  • 77
  • You say "R console" but it's not clear how you started up the instance of R. Did you start R from a Terminal session? Aslo, which version of R did you install. There are two binary versions. – IRTFM Jul 08 '14 at 01:32
  • @BondedDust I didn't started R from Mac terminal. By "R console" I meant the normal R widow where we issue commands like install.packages(). Also I have already mentioned the version of R in above post `(version 3.1.0)` – user2966197 Jul 08 '14 at 02:10
  • "normal Mac window" and not starting from Terminal session suggests you are using the R.app GUI. That is _not_ recommended for Rserve initiation. – IRTFM Jul 08 '14 at 02:47
  • @BondedDust but everywhere on web thee is no mention of such limitation. Every where it is given that you can start the Rserve from normal R console(within R). – user2966197 Jul 09 '14 at 15:13
  • Best place to pose Q is R-SIG-Mac. I don't consider the R,app to be what is typically meant when people say "normal console" but Simon Urbanek would be the authority since he wrote much of both R.app and Rserve. – IRTFM Jul 09 '14 at 20:30

3 Answers3

6

I also had this problem today.

Rserve is using openSSL library that is deprecated in mac OS X 10.7 Lion. This causes the error: installation of package ‘Rserve’ had non-zero exit status So, I couldn't install Rserve by `install.packages('Rserve') in R console.

To avoid this, the binaries for mavericks was installable for me:

http://cran.r-project.org/bin/macosx/mavericks/contrib/3.1/

I downloaded Rserve_1.7-3.tgz and did R CMD INSTALL Rserve_1.7-3.tgz Then I could run Rserve by library(Rserve) and Rserve() in R console.

It seems that latest version of Rserve 1.8 is not available.(?)

gecko655
  • 313
  • 2
  • 9
3

To do this from inside R, you can run the following:

pkg_url <- "http://cran.r-project.org/bin/macosx/mavericks/contrib/3.1/Rserve_1.7-3.tgz"
install.packages(pkg_url, repos = NULL)

where the package URL was obtained from the link for "Mavericks binaries" on the CRAN page (towards the bottom).

shadowtalker
  • 12,529
  • 3
  • 53
  • 96
0

Same problem happened to me when I ran the function Rserve() It gave an error - Fatal error: you must specify --save, --no-save or --vanilla

So I tried using this code, and the server got initiated.

Rserve::run.Rserve()

I hope this helps.

The Hungry Dictator
  • 3,444
  • 5
  • 37
  • 53