如何打包和发布Ruby应用程序? [英] How to package and release a Ruby application?

查看:484
本文介绍了如何打包和发布Ruby应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Ruby应用程序(所以没有Rails!),并希望将其发布给公众".在我的Mac上,我已设置$PATH使其包含我的应用程序的bin目录,因此我只需输入executable_name作为命令即可.

I,ve got a Ruby app (so no Rails!) and want to release it to 'the public'. On my mac, I've set up the $PATH to include the bin directory of my app, so I can just type executable_name as a command.

但是,当有人安装应用程序时,他们将不得不像我一样将bin目录添加到他们的$PATH中.这不是我想要的那么简单.是否可以让用户使用Homebrew或类似的东西进行安装?还是我想念我不知道的东西?你们一般情况如何?

However, when somebody installs the app, they would have to add the bin directory to their $PATH like I did. This is not as easy as I would like. Is it possible to let users install with Homebrew or something similar? Or maybe I'm missing something I did't know about? How do you guys generally go about this?

为了完整性->文件结构:

For the sake of completeness -> the file structure:

|- my_application

   |- bin
      |- executable

   |- lib
      |- my_class.rb
      |- my_class.rb
      |- my_class.rb

   |- tests
      |- my_tests.rb

推荐答案

Ruby中,任何名为gem的lib/应用程序都应通过rubygems安装.阅读 how make your own gem .这就是您所需要的全部.

In Ruby any lib/application called gem and should be installed via rubygems. Read how make your own gem. This all what you need.

It is contain section about adding executable

这篇关于如何打包和发布Ruby应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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