在Heroku上使用R和Rails

dor*_*emi 5 ruby r ruby-on-rails heroku

我正在努力让我们的Rails应用程序使用rserve服务器rserve-simpler gem 与R交谈.

当我加载我的应用程序时,一切都在本地工作正常,但在Heroku中,我的rails应用程序无法连接到rserve,即使该工作程序已成功启动部署.

app[web.1]: Rserve::Connection::RserveNotStartedError (Can't start Rserve):
Run Code Online (Sandbox Code Playgroud)

以下是我配置的详细信息.

.buildpacks

https://github.com/heroku/heroku-buildpack-ruby.git
http://github.com/virtualstaticvoid/heroku-buildpack-r.git#cedar-14
Run Code Online (Sandbox Code Playgroud)

Procfile

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
rserve: R -f rserve.r --gui-none --no-save
Run Code Online (Sandbox Code Playgroud)

rserve.r

require('Rserve')

# get the port allowed
port <- Sys.getenv('PORT')

# run Rserve in process
run.Rserve(debug = TRUE, port, args = NULL, config.file = "./rserve.conf")
Run Code Online (Sandbox Code Playgroud)

rserve.conf

remote enable
Run Code Online (Sandbox Code Playgroud)

如您所见,rails在一个dynco上运行,而rserver在heroku中的另一个dyno上运行.

我怀疑因为rserve正在使用不同的dyno运行,rails无法使用默认连接参数与rserve通信,但我不确定如何或者甚至可以解决这个问题.任何帮助将不胜感激.

编辑: 来自Dynos上的Heroku:

即使在相同的物理基础设施上,Dynos也可以彼此完全隔离.

这再次强化了我的怀疑,即使用rails连接到rserve运行到不同的dyno是不可能的.

有没有办法解决?