How to Create a Ruby Gem

H

Each time I create a gem I do the same search again and again. I keep saving the URLs in here and there and it’s really getting awkward. So I decided to write my own post about it.

LT;DR

bundle gem GEMNAME
bundle gem GEMNAME
Creating gem 'GEMNAME'...
MIT License enabled in config
      create  GEMNAME/Gemfile
      create  GEMNAME/lib/ossga.rb
      create  GEMNAME/lib/ossga/version.rb
      create  GEMNAME/ossga.gemspec
      create  GEMNAME/Rakefile
      create  GEMNAME/README.md
      create  GEMNAME/bin/console
      create  GEMNAME/bin/setup
      create  GEMNAME/.gitignore
      create  GEMNAME/LICENSE.txt
Initializing git repo in /full/path/ossga

 

Packing the gem into gem file

cd GEMNAME
gem build GEMNAME.gemspec

 

Pushing the gem to Rubygems.org

gem push GEMNAME-0.0.1.gem

Resources

About the author

KING SABRI

We Have Nothing Without Knowledge ... Knowledge Have Nothing Without Us

Add comment

Leave a Reply

By KING SABRI

Hacker, Sr. consultant & team lead | Author of @Rubyfu | MCITP-EA, CCNA, RHCE, CEH, OSCP, GWAPT, OSCE

find / -name “me”