Update ruby gem version with new changings

106 Views Asked by At

I have developed a gem for learning purposes and push it to https://rubygems.org/gems/combination-pairs. Now I want to do some changes in the code of the gem. Means I want to update my same gem but with different version. How can we do the same??

1

There are 1 best solutions below

0
On

Follow these steps to update your ruby gem with changes:

  1. Keep testing your code and make the required changes in your gem code (locally)
  2. Once you are done with Step 1, update the version of your gem in lib/combination/pairs/ version.rb file by following the Semantic Versioning Guidelines. Let's say you change the version of your gem to 0.0.2
  3. Next, run bundle install command in your gem's working directory to install all the gem dependencies.
  4. And finally, run the task rake release which will create tag v0.1.2 and build and push combination-pairs-0.0.2.gem to Rubygems. This task is available to you as I see that you have the following line in the Rakefile

    require "bundler/gem_tasks"
    

    You can double check the list of available rake tasks by executing the command

    rake -T
    

NOTE:

Just for your reference, check out this awesome Railscasts by Ryan Bates: New Gem with Bundler