Rserve connection, Mac user

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Rserve connection, Mac user

Ralitsa
Hello

I am new to Bio7 and want to try it for high-throughput ImageJ analysis.
I keep getting the following error when I try to start Rserve; I have tried to specify an R path and to turn off the firewall, but I must be doing something wrong because these actions won't solve the problem. Unless I am not specifying the right path. I have, of course, installed the Rserve package within R, but have not done much more beyond that - am I missing a step?

Here is the error message:

java.io.IOException: Cannot run program "/Applications/R.app/Contents/MacOS/bin/R": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at com.eco.bio7.console.ConsolePageParticipant.processRCommand(ConsolePageParticipant.java:676)
        at com.eco.bio7.console.ConsoleInterpreterAction.startR(ConsoleInterpreterAction.java:286)
        at com.eco.bio7.rbridge.actions.StartRServe.run(StartRServe.java:148)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
        at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4230)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1491)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1514)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1499)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1299)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at com.eco.bio7.rcp.Application.start(Application.java:61)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 36 more

I hope someone will be able to assist me with this. Thank you in advance,

Ralitsa
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Marcel
Hello Ralitsa,

in my FAQ I proposed the following default path to R (the R dir is calculated):

The default R installation path on MacOSX is (version number can differ):

/Library/Frameworks/R.framework/Versions/3.2/Resources

Simply copy and paste the path in the Bio7 preferences:

http://bio7.org/manual/Main.html#toc-Section-6.1

And I hope you have installed my version of Rserve for cooperative mode, see:

http://bio7.org/manual/Main.html#toc-Subsubsection-2.1.2.3


See also the help on YouTube:

https://www.youtube.com/channel/UCFY-w-tMbVzhrLro4Q2KbFg/

I hope this info helps.

Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Ralitsa
Hi Marcel

Thanks for the help! I tried your suggestion, and I tried with both "3.2" and "Current" as version, but I still get an error:
java.io.IOException: Cannot run program "/Library/Frameworks/R.framework/Versions/Current/Resources /bin/R": error=2, No such file or directory

I did install the package that you had suggested (see below). Should I load it into the library or just do nothing after installing it? I am sorry for being a bit ignorant!

> install.packages("https://bitbucket.org/maustenfeld/bio7-new/downloads/Rserve_1.8-4_Mac_cooperative.tgz", repos=NULL)
trying URL 'https://bitbucket.org/maustenfeld/bio7-new/downloads/Rserve_1.8-4_Mac_cooperative.tgz'
Content type 'application/x-tar' length 438408 bytes (428 KB)
==================================================
downloaded 428 KB
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Marcel
Dear Ralitsa,

the error message is just a wrong path error.

Please control if the path is existent on you OS. It might be that you have an older or newer version installed (type R.version in the R shell to find out the version)?

It might be that you have a different version number installed.

try this shell command to list all paths:

ls -l /Library/Frameworks/R.framework/Versions/

You need adjust the path so that the R /bin folder is a subfolder (the /bin/R path will be calculated from the given path):

The path below is present after the installation of the stable R-3.2.2.pkg from CRAN!

(Click on the browse button in the preferences if you can find a directory similar to this latest R version installed):

/Library/Frameworks/R.framework/Versions/3.2/Resources

Please note that the path might be different if installed from  from source or via a package manager like MacPorts or Homebrew.

Then the path could be:

/usr/bin/R
or
/usr/local/bin/R
or
/opt/local/bin/R


If you have installed Rserve everything should be fine and will be started (loaded) automatically if your path is correct and Rserve is started from the toolbar.
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Marcel
In reply to this post by Ralitsa
Please note that the Current directory is a symbolic link which references the latest version.

See also:

https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html

10.10 Why is R.home() in the R framework not versioned?
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Ralitsa
Hi Marcel,

It works now! I did the R.home() and the path is: "/Library/Frameworks/R.framework/Resources"

Thanks so much for all your help!
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Marcel
Glad to hear.

It is a pity that R on MacOSX is not on the default PATH environment variable like in Linux.

In the next release I will consider this path as default.

Just one note:

In Bio7 R is started within a shell and then Rserve is started from within the shell connection automatically.

If you close the Rserve connection (Bio7 toolbar) R is still alive (all variables from Rserve preserved!)

If you want to close R at all use the the Bio7 shell action:

Menu Options->Stop Native Process (R,...)

which terminates the Java controlled R process.

If that doesn't work use the "Stop All Natives R Processes" action which kills all active R sessions.
(necessary if two Rserve sessions are alive because of an uncaught native error. Guarantees that no R session on the OS is still alive when starting a new R process connection).
Reply | Threaded
Open this post in threaded view
|

Re: Rserve connection, Mac user

Ralitsa
Thank you!! Very useful for an amateur like me. 

On 16 Nov 2015, at 14:04, Marcel [via Bio7] <[hidden email]> wrote:

Glad to hear.

It is a pity that R on MacOSX is not on the default PATH environment variable like in Linux.

In the next release I will consider this path as default.

Just one note:

In Bio7 R is started within a shell and then Rserve is started from within the shell connection automatically.

If you close the Rserve connection (Bio7 toolbar) R is still alive (all variables from Rserve preserved!)

If you want to close R at all use the the Bio7 shell action:

Menu Options->Stop Native Process (R,...)

which terminates the Java controlled R process.

If that doesn't work use the "Stop All Natives R Processes" action which kills all active R sessions.
(necessary if two Rserve sessions are alive because of an uncaught native error. Guarantees that no R session on the OS is still alive when starting a new R process connection).


If you reply to this email, your message will be added to the discussion below:
http://bio7.622846.n4.nabble.com/Rserve-connection-Mac-user-tp4640296p4640303.html
To unsubscribe from Rserve connection, Mac user, click here.
NAML