From 2fea8e723ba251fb2408143e4f6c194811e98949 Mon Sep 17 00:00:00 2001 From: William Estoque Date: Thu, 25 Apr 2024 17:43:49 +0800 Subject: [PATCH] Add more gem docs in Rails Application Templates guide Added doc on how to add a gem with a specific version. Added doc on how to add a comment. --- guides/source/rails_application_templates.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md index b27b81d1a28..42d7578eaa9 100644 --- a/guides/source/rails_application_templates.md +++ b/guides/source/rails_application_templates.md @@ -62,6 +62,18 @@ gem "nokogiri" Note that this method only adds the gem to the `Gemfile`; it does not install the gem. +You can also specify an exact version: + +```ruby +gem "nokogiri", "~> 1.16.4" +``` + +And you can also add comments that will be added to the `Gemfile`: + +```ruby +gem "nokogiri", "~> 1.16.4", comment: "Add the nokogiri gem for XML parsing" +``` + ### gem_group(*names, &block) Wraps gem entries inside a group.