如何打包和发布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