alexgutteridge / rsruby

Ruby - R bridge.
http://rubyforge.org/projects/rsruby/
GNU Lesser General Public License v2.1
332 stars 59 forks source link

Fatal error: R home directory is not defined #26

Closed sebastianzillessen closed 8 years ago

sebastianzillessen commented 8 years ago

Hi.

I installed R with home-brew, it is located in /usr/local/Cellar/r/3.3.0/R.framework/Resources:

ls /usr/local/Cellar/r/3.3.0/R.framework/Resources
lrwxr-xr-x  1 admin    26B  3 May 08:13 /usr/local/Cellar/r/3.3.0/R.framework/Resources@ -> Versions/Current/Resources

Then I followed the installation instructions:

R_HOME=R_HOME=/usr/local/Cellar/r/3.3.0/R.framework/Resources`
gem install rsruby -- --with-R-dir=$R_HOME
Building native extensions with: '--with-R-dir=/usr/local/Cellar/r/3.3.0/R.framework/Resources'
This could take a while...
Successfully installed rsruby-0.5.1.1
1 gem installed
rails c
Loading development environment (Rails 4.2.6)
2.2.4 :001 > r = RSRuby.instance
Fatal error: R home directory is not defined

Any ideas what is going wrong?

Thanks!

davidraba commented 8 years ago

Same issue, are you still looking for solution? It worked on my scripts by setting: ENV['R_HOME'] = "/Library/Frameworks/R.framework/Resources"

sebastianzillessen commented 8 years ago

No, I changed to rinruby and did my modifications there.

https://github.com/sebastianzillessen/rinruby

mkfs commented 6 years ago

This isue may be closed, but seems a good a place as any to post the idiom I've been using in my code based on rsruby:

  ENV['R_HOME'] ||= `R RHOME`.chomp