Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the current correct way to publish gems?

Tags:

ruby

rubygems

gem

The correct process of publishing gems seems to always be in flux, and it's been a while since I've done it. Is there an up to date set of best practices for bundling ruby libraries into gems and publishing them?

like image 735
fields Avatar asked Nov 13 '22 19:11

fields


1 Answers

The best thing to learn how to publish gems is to browse the documentation on guides.rubygems.org.

Here are a few pointers:

  • To learn the patterns to bundle a gem, read this article, or explore a gem example.
  • The .gemspec file is a descriptor to build your gem. You can read the detailed specifications here.

Finally, build your gem named hola with:

gem build hola.gemspec

This will create a hola-0.0.1.gem file.

To publish your gem to rubygems.org (you’ll need a user account on rubygems.org first):

gem push hola-0.0.1.gem
like image 160
edouardbriere Avatar answered Jan 04 '23 03:01

edouardbriere