Reputation: 968
asked the next thing from Heroku support the other day:
I have an app that will require a client library written in C++. I have doubts can that be done with Heroku. Is it possible at all, any alternatives how can a C++ library be installed and used by an app with Heroku?
And I got the next answer:
We currently don't have a good way to do this. You'll need to figure out how to package into your app and compile static x64 binaries into the repo.
I haven't done that before. Does anyone have any good pointers how package a C++ library into a Rails app so it can be used with Heroku?
Thanks.
Upvotes: 17
Views: 3011
Reputation: 1265
To wrap the C++ library in Ruby, you want Rb++.
Alternately, you can wrap the C++ library in C and then wrap that with Ruby-FFI.
I'm not sure what, if anything, one can do to get the native extensions compiled on Heroku. I'd contact their support and ask.
Upvotes: 7
Reputation: 6337
I haven't done this either, but my guess would be that you could write a wrapper gem around it, and make the C++ library be a native extension in the gem.
Upvotes: 4