Hi all-
About a week ago, I succeeded in building R 2.13.1 on Heroku
(
www.heroku.com). For those of you who aren't familiar, Heroku is a
popular hosting platform for Ruby on Rails, NodeJS, and other
applications -- it makes it easy to have an application running with
little more than a "git push". Getting R on it ends up being a bit
tricky, since it's not installed by default, it's a read-only
filesystem, and there's no root access to just do a "sudo apt-get
install".
My original purpose in installing R was to call it from a ruby app to
provide some statistics capabilities, but it wasn't a big leap from
there to get Rook running on Heroku. I've put a more detailed readme
(still quite rough) and code for a working example at
https://github.com/noahhl/rookonheroku -- you can see the working demo
at
http://rookonheroku.herokuapp.com/custom/RookTest.
I'll leave the full details to the readme on github, but the short
story of how to do this is:
1) Create a dummy Heroku ruby app, push it, get shell access, install
dependencies and build R. Then copy your built R back to your computer
(or start from the demo repo on GH).
2) Build your rook application. Set it to run bound to 0.0.0.0 and on
the port specified by the environment variable PORT.
3) Wrap up your rook application to be run via ruby -- this is needed
because Heroku doesn't know we're running a web server if we directly
launch R, but we can tell it it's launching a webserver via a
config.ru file, and then just do whatever we wish with that file.
It's not as easy as getting a Rails app running on Heroku, but
hopefully folks find this useful. Happy to try to answer any questions
people have.
Noah