Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this library still work for Ruby 2.5.5 and R 4.1.0? #54

Closed
davidkrider opened this issue Jul 12, 2021 · 6 comments
Closed

Does this library still work for Ruby 2.5.5 and R 4.1.0? #54

davidkrider opened this issue Jul 12, 2021 · 6 comments

Comments

@davidkrider
Copy link

davidkrider commented Jul 12, 2021

I'm trying to integrate R into my Rails app with this library as a gem, but calls to R just hang. I'm on macOS. I've added the gem and bundled, and installed R from Homebrew. As a raw, baseline test, I've created a test file with the example from the top of the rinruby.rb file. But when I try to run the example, it just hangs. When I kill it, I get this stack trace, and I have no idea how to start trying to fix it:

tasks git:(statistics) ✗ ruby test.rb
^CTraceback (most recent call last):
	7: from test.rb:7:in `<main>'
	6: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:349:in `method_missing'
	5: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:394:in `assign'
	4: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:760:in `assignable?'
	3: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:742:in `complete?'
	2: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:630:in `socket_session'
	1: from /Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:744:in `block in complete?'
/Users/davidkrider/.rvm/gems/ruby-2.5.5/gems/rinruby-2.1.0/lib/rinruby.rb:744:in `read': Interrupt

@davidkrider
Copy link
Author

It works on Linux with Ruby 2.5.8 and R 3.6.3.

@pddzaic
Copy link

pddzaic commented Sep 30, 2021

I have the same issue in Windows 10, Ruby 2.6.8 and R 4.1.1. I can confirm, that the gem works with R 3.6.3.

By the way: Is this project dead?

@mcmaclachlan
Copy link

Same problem on RHEL 8, Ruby 2.7.1, R 4.1.1(and.2). Worked with R 4.0.5.

@martyn-w
Copy link
Contributor

martyn-w commented Dec 9, 2021

HI all, I had the same issue with Ruby 3, R 4.1.2. It turns out there was a breaking change in R 4.1.0 which blocks the ability to assign variables to the base environment. I've made a trivial fix (one line) in this PR which has resolved the problem: #55

irb(main):001:0> require "rinruby"
irb(main):002:0> R.eval("rnorm(5)")
[1] -1.4791180  1.2530975 -0.4628176  0.8099531  0.9796833

@intersimone999
Copy link

Thanks a lot @martyn-w, I had the same problem and I can confirm that it works now with your patch.

@davidkrider
Copy link
Author

I haven't had a chance to confirm, but I'll take it from intersimone999 that it's GTG. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants