A simple Ruby gem example for testing its usage in an IRB console
gem build sample_gem.gemspec
gem install ./sample_gem-0.1.0.gem
irb
In the IRB session, require your gem:
require 'sample_gem'
Now, you can create an instance of SampleGem and call its methods:
gem_instance = SampleGem.new
gem_instance.greet
You should see the output:
SampleGem instance created!
Hello from SampleGem!