0Pricing
Ruby Academy · Lesson

Gem Structure

Files and gemspec.

What Is a Gem?

A gem is a packaged Ruby library or application that can be installed, versioned, and shared through RubyGems. Almost every Ruby tool you use is a gem.

  • A gem bundles code, metadata, and dependencies.
  • The metadata lives in a gemspec file.
  • Tools like bundler and gem manage gems.

Generating a Skeleton

The fastest start is bundle gem mygem. It scaffolds the standard directory layout, a gemspec, a test folder, a README, and a license. You then fill in the code.

All lessons in this course

  1. Gem Structure
  2. Writing the Code
  3. Testing and Versioning
  4. Publishing to RubyGems
← Back to Ruby Academy