series: Guide Ruby

Introduction

This guide will walk you through the process of creating a RubyGem, building it, pushing it to Gemfury, and then installing it. Before you get started, be sure you have the following: Gemfury account Local Ruby installation Bundler installed locally

Creating a gem

To create a gem, minimally, you only need a .gemspec specification file. However, most gems are a combination of libraries, tests, documentation, and more. To quickly create a scaffold that includes those, we recommend using Bundler’s generator: bundle gem GEM_NAME This will create a directory GEM_NAME with the initial gem structure including the GEM_NAME.gemspec specification. Take a look inside – it’s just a Ruby file. Before you can build this gem, you will need to fill out the specification fields marked with TODO. 

Upload your gem

Now that you have the structure of the RubyGem in place, you have a number of ways to upload it to your Gemfury account. You can use the Dashboard, cURL, the Gemfury CLI, or Git. Pushing from terminal You already have a prebuilt gem from the previous step, so let’s upload it directly from a terminal: gem build GEM_NAME.gemspec curl -F package=@GEM_NAME-0.1.0.gem https://TOKEN@push.fury.io/USERNAME/ If you’ve installed the Gemfury CLI, you can also push with: