从Rails应用程序内部调用rubygem的二进制可执行文件? [英] Call a rubygem's binary executable from inside my rails applications?

查看:80
本文介绍了从Rails应用程序内部调用rubygem的二进制可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道捆绑程序使用 bundle exec 命令使gems可执行文件可用。我想了解如何从控制器动作或模型类方法内部调用这些可执行文件?我在Bundler doco中什么都没有看到。

I know that bundler makes a gems executables available using the bundle exec command. I want to understand how I can call these executables from inside a controller action or model class method? I don't see anything about this in the Bundler doco.

推荐答案

可执行文件是 bin 目录及其行为取决于每个宝石。它们是gems类/ API的包装器:只需深入研究您所定位的gems的源代码并模仿其CLI的行为即可。

Executables are ruby scripts sitting in the bin directory of the gems and their behavior depend on each gem. They are wrappers around the gems classes/APIs: simply dig into the source code of the gems you target and mimic the behavior of their CLIs.

这篇关于从Rails应用程序内部调用rubygem的二进制可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆