Using R with Rails on Heroku

I'm working on getting our Rails application talking to R using rserve server and the rserve-simpler gem.

Everything works fine locally when I load my app, but in Heroku, my rails app is unable to make a connection to rserve, even though the worker successfully started on deploy.

app[web.1]: Rserve::Connection::RserveNotStartedError (Can't start Rserve):

Below are the details of my configuration.

.buildpacks

https://github.com/heroku/heroku-buildpack-ruby.git
http://github.com/virtualstaticvoid/heroku-buildpack-r.git#cedar-14

Procfile

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
rserve: R -f rserve.r --gui-none --no-save

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")

rserve.conf

remote enable

As you can see, rails is running on one dynco and rserver is running on another dyno in heroku.

I suspect that because rserve is running on a different dyno, rails can't talk to rserve using the default connection parameters, but I'm not sure how or even if I could fix this. Any help would be greatly appreciated.

Edit: From Heroku on Dynos:

Dynos execute in complete isolation from one another, even when on the same physical infrastructure.

This is re-enforcing my suspicions that it won't be possible to have rails make a connection to rserve running into a different dyno.

Is there any way around this?

链接地址: http://www.djcxy.com/p/61722.html

上一篇: 如何删除输入文本元素上的边框突出显示

下一篇: 在Heroku上使用R和Rails