How to package and release a Ruby application?

2019-08-31 11:45发布

问题:

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.

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

回答1:

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