# R integration: Cannot install Rserve

**URL:** <https://forum.knime.com/t/r-integration-cannot-install-rserve/38785>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [January 14, 2022, 3:26pm UTC](https://forum.knime.com/t/r-integration-cannot-install-rserve/38785 "2022-01-14T15:26:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehsanT](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ehsant/32/35033_2.png) [@ehsanT](https://forum.knime.com/u/ehsanT)\
**Post date:** [January 14, 2022, 3:26pm UTC](https://forum.knime.com/t/r-integration-cannot-install-rserve/38785/1 "2022-01-14T15:26:26Z")

</div>

Hello,

Following [this instruction](https://docs.knime.com/2019-12/r_installation_guide/index.html#_windows) to integrate R and Knime, I could not install Rserve on the local R instance.

I am trying to integrate Knime and R on windows 10.

I copied the error as follows:

"C:/rtools40/mingw32/bin/“gcc -I"C:/PROGRA~1/R/R-4.1.2/include” -DNDEBUG -DRSERVE\_PKG -DWin32 -I. -Iinclude -Iinclude/Win32 -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c oc.c -o oc.o  
oc.c:11:10: fatal error: openssl/rand.h: No such file or directory  
#include \<openssl/rand.h\>  
^ ~~~~~~~~~~~~~~~  
compilation terminated.  
make: \*\*\* [C:/PROGRA~1/R/R-4.1.2/etc/i386/Makeconf:238: oc.o] Error 1  
ERROR: compilation failed for package ‘Rserve’

- removing ‘C:/-----/Rpackages/Rserve’  
Warning in install.packages :  
installation of package ‘Rserve’ had non-zero exit status

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 15, 2022, 3:02pm UTC](https://forum.knime.com/t/r-integration-cannot-install-rserve/38785/2 "2022-01-15T15:02:05Z")

</div>

@ehsanT what you should do is make sure RServe does run under R / Studio alone and will be started when library(“Rserve”) is called. Then you could tray the integration into KNIME.

In order to do a fresh installation you might try these steps if the ones from the R integration guide would not work. The latest Version 1.8-10 should be available as a Windows binary so there would be no need to compile:

[https://CRAN.R-project.org/package=Rserve](https://cran.r-project.org/package=Rserve)

For Windows:

```auto
install.packages("Rserve", repos = "https://cran.r-project.org", type="win.binary")

```

If this is not successful you could try and do a installation via the [installr package](https://CRAN.R-project.org/package=installr) like this:

```auto
# install.packages("installr")

library(installr)
install.packages.zip("https://cran.r-project.org/bin/windows/contrib/4.1/Rserve_1.8-10.zip")

```

or:

```auto
install.packages("https://cran.r-project.org/bin/windows/contrib/4.1/Rserve_1.8-10.zip", repos = NULL, type ="win.binary")

```

You might want to check the latest binary version on the [Rserve website](https://cran.r-project.org/package=Rserve):

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/2/1/21b6ddfd36d11142030cf0b1fdd3088cb9454d42.png)

* * *

The same thing for MacOS would look like this:

```auto
install.packages("Rserve", repos = "https://cran.r-project.org", type="mac.binary")

```

Or you could do with the specific package version:

```auto
install.packages("https://cran.r-project.org/bin/macosx/contrib/4.1/Rserve_1.8-10.tgz", repos = NULL, type ="mac.binary")

```

Besides the [official guide to R and KNIME integration](https://docs.knime.com/latest/r_installation_guide/index.html#_introduction) I try to keep track of several ways and quirks around KNIME and R/RStudio here:

> **[A meta collection and article about R and KNIME – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/_r_installation_on_knime_collection~tj5tS_6gYvqOSPlk)**
>
> A meta collection and article about R and KNIME R gives you the power to do a lot of great things combined with KNIME but to get R and KNIME together up and ru…

You could check the version and packages of your R installation in KNIME here:

> **[check version of R packages in KNIME – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_r_check_version_of_package~annQfxz-Mrtn2BNm)**
>
> demonstrates how to check the versions of every R package. And specifically check for the version of the RServe package. With the help of the package sessionin…

---

<div class="post-metadata">

**Author:** ![ehsanT](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ehsant/32/35033_2.png) [@ehsanT](https://forum.knime.com/u/ehsanT)\
**Post date:** [January 17, 2022, 9:35am UTC](https://forum.knime.com/t/r-integration-cannot-install-rserve/38785/3 "2022-01-17T09:35:03Z")

</div>

Thank you @mlauber71 . It was fixed by running the first line of code.  
👌

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [January 24, 2022, 9:36am UTC](https://forum.knime.com/t/r-integration-cannot-install-rserve/38785/4 "2022-01-24T09:36:03Z")

</div>

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