如何在 rails 项目中包含 C++ 绑定 [英] How to include c++ bindings in a rails project
问题描述
我问了这个 关于 r 树的问题,答案包括使用带有一些 ruby 的 C++ 库包装纸.我已经让包装器在测试文件中工作,但如何将包装器包含在我的 Rails 项目中?
I asked this question about r-trees and the answer included using a c++ library with some ruby wrappers. I've gotten the wrapper to work in a test file, but how can I include the wrapper in my rails project?
推荐答案
我在 /lib
文件夹中包含了包含文件的文件夹(在本例中为 RTREE
)我的项目.然后我从该文件夹中运行 ruby exconf.rb
.最后,我在我的项目中包含了必要的文件(require RBOOST/rboost_rtree_2d_rect
).有了这个,我很高兴.
I included the folder containing the files (RTREE
in this case) in the /lib
folder of my project. I then ran ruby exconf.rb
from within that folder. Lastly, I included the necessary file in my project (require RBOOST/rboost_rtree_2d_rect
). With that, I was good to go.
这篇关于如何在 rails 项目中包含 C++ 绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!