Creating an executable GEM from a script

Recently, I started developing ruby, and I really like it, but I feel somehow lost. I developed a script that does "anything" and that scripts require a lot of gems such as nokogiri and colorize . Now I want to deploy the script, so after reading for a while, I found a lot of people saying that it is best to use the deployment as a gem. So my question is simple? Is there any tool I can use to create the pearl of my script file and include all the gem (nokogiri) properties associated with it in a new stone?

I am using ubuntu!

Thank you so much

+3
source share
2 answers

Building a gem consists mainly of creating a simple directory structure for your script and a special file known as gemspec that will list all its dependencies. This gemspec can be used with rubygems to create a gem file (* .gem) that can be installed using rubygems or uploaded to rubygems.org for public consumption.

There are several tools that automate part of this process. Relatively simple is the Bundler gem, which will take care of dependencies during development and make it easier for you to pack your gem. This article contains enough information to get started with gem development using bundler.

+5
source

- - :

# bundler gem (gem_name)
bundler gem geil_gem

gemspec , , setup, console ( bin ). binary gem lib , rspec gemspec .

0

All Articles