Search code examples
ruby-on-railsrubygemspecs

Can anyone tell me what the purpose of a Gemspec file in Ruby is?


After combing through Google I know what goes in a gemspec file for my project, but I have no clue as to why we need it, I guess I'm looking for a practical definition.

(Currently working through Learn Ruby the Hard Way by Zed Shaw, this was one of the study questions)


Solution

  • According to the official RubyGems site:

    The gemspec defines what’s in the gem, who made it, and the version of the gem. It’s also your interface to RubyGems.org. All of the information you see on a gem page (like jekyll’s) comes from the gemspec.

    Once your gemspec file is sorted out you build it to assemble your gem.