简体   繁体   English

如何将python库集成到Ruby on Rails应用程序中

[英]How to integrate a python library into a Ruby on Rails application

I want to know if there is a way to integrate a library written in Python into my Rails application. 我想知道是否可以将用Python编写的库集成到我的Rails应用程序中。 I have always used gems to implement outside libraries so I have no idea how to do this(yet). 我一直使用gem来实现外部库,因此我不知道如何执行此操作。

Is it possible to use this Python library? 是否可以使用此Python库?

This is mostly what you want: 这主要是您想要的:

Calling Python from Ruby 从Ruby调用Python

I've looked into this question before and, excepting the Heroku deploy, the answer was "easily! check this out". 我之前已经研究过这个问题,除了Heroku部署外,答案是“轻松!检查一下”。 (On a fun note, there's a gem to let you embed Perl code in a Ruby file) (有趣的是,有一个宝石可以让您将Perl代码嵌入到Ruby文件中)

However, while I can't seem to find it right now, I remember reading that deploying both to Heroku required a custom buildpac, since one won't normally include the binaries necessary for the other. 但是,尽管我现在似乎找不到它,但我记得读过,将两者部署到Heroku都需要自定义buildpac,因为一个通常不会包含另一个二进制文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM