BUNDLE-GEM(1)
π NAME π
bundle-gem β bestie, this is the glow-up button that generates a whole project skeleton so you can create a rubygem. Iconic behavior, no cap. β¨
πΈ SYNOPSIS πΈ
bundle gem GEM_NAME OPTIONS
π¦ DESCRIPTION π¦
So here's the vibe: it generates a directory named GEM_NAME, and inside that directory you get a Rakefile, a GEM_NAME.gemspec, and a bunch of other supporting files and directories. All of it is there so you can develop a rubygem with that name. It's giving starter pack, and it ate. π
Once you're inside the resulting project, run rake -T and it'll hand you a list of Rake tasks you can use to test and publish the gem to rubygems.org. Yes queen, testing and publishing. π
You can customize the generated project skeleton with OPTIONS, as explained down below. And lowkey the important part: these options can also be specified via Bundler's global configuration file, using these names:
gem.cocgem.mitgem.test
β¨ OPTIONS β¨
--exe,--bin,-bβ tells Bundler to create a binary executable (asexe/GEM_NAME) in the generated rubygem project. That binary also gets added to theGEM_NAME.gemspecmanifest. This behavior is disabled by default, so if you want it you have to ask for it, fr fr.--no-exeβ do not create a binary. This overrides--exeif it was specified in the global config. Rude to the binary, but valid. π--cocβ adds aCODE_OF_CONDUCT.mdfile to the root of the generated project. If you don't specify this option, an interactive prompt pops up and your answer gets saved in Bundler's global config for futurebundle gemuse. π--no-cocβ do not create aCODE_OF_CONDUCT.md(overrides--cocspecified in the global config).--changelogβ adds aCHANGELOG.mdfile to the root of the generated project. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for futurebundle gemuse. You can also update the default withbundle config set --global gem.changelog <true|false>. Keeping receipts? Obsessed. π§--no-changelogβ do not create aCHANGELOG.md(overrides--changelogspecified in the global config).--ext=c,--ext=go,--ext=rustβ adds boilerplate for C, Go (currentlygo-gem-wrapperhttps://github.com/ruby-go-gem/go-gem-wrapper based) or Rust (currentlymagnushttps://docs.rs/magnus based) extension code to the generated project. This behavior is disabled by default. π--no-extβ do not add extension code (overrides--extspecified in the global config).--gitβ initializes a git repo inside your library. Version control bestie, we love to see it. π--github-username=GITHUB_USERNAMEβ fills in the GitHub username on the README so that you don't have to do it manually. Set a default withbundle config set --global gem.github_username <your_username>.--mitβ adds an MIT license to aLICENSE.txtfile in the root of the generated project. Your name from the global git config is used for the copyright statement. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for futurebundle gemuse.--no-mitβ do not create aLICENSE.txt(overrides--mitspecified in the global config).-t,--test=minitest,--test=rspec,--test=test-unitβ specify the test framework that Bundler should use when generating the project. Acceptable values areminitest,rspecandtest-unit. TheGEM_NAME.gemspecwill be configured and a skeletontest/specdirectory will be created based on this option. Given no option is specified:- When Bundler is configured to generate tests, this defaults to Bundler's global config setting
gem.test. - When Bundler is configured to not generate tests, an interactive prompt will be displayed and the answer will be used for the current rubygem project.
- When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future
bundle gemuse.
- When Bundler is configured to generate tests, this defaults to Bundler's global config setting
--no-testβ do not use a test framework (overrides--testspecified in the global config). Testing is self-care but it's your call. π--ci,--ci=circle,--ci=github,--ci=gitlabβ specify the continuous integration service that Bundler should use when generating the project. Acceptable values aregithub,gitlabandcircle. A configuration file will be generated in the project directory. Given no option is specified:- When Bundler is configured to generate CI files, this defaults to Bundler's global config setting
gem.ci. - When Bundler is configured to not generate CI files, an interactive prompt will be displayed and the answer will be used for the current rubygem project.
- When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future
bundle gemuse.
- When Bundler is configured to generate CI files, this defaults to Bundler's global config setting
--no-ciβ do not use a continuous integration service (overrides--cispecified in the global config).--linter,--linter=rubocop,--linter=standardβ specify the linter and code formatter that Bundler should add to the project's development dependencies. Acceptable values arerubocopandstandard. A configuration file will be generated in the project directory. Given no option is specified:- When Bundler is configured to add a linter, this defaults to Bundler's global config setting
gem.linter. - When Bundler is configured not to add a linter, an interactive prompt will be displayed and the answer will be used for the current rubygem project.
- When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future
bundle gemuse.
- When Bundler is configured to add a linter, this defaults to Bundler's global config setting
--no-linterβ do not add a linter (overrides--linterspecified in the global config).--edit=EDIT,-e=EDITβ open the resultingGEM_NAME.gemspecin EDIT, or the default editor if not specified. The default is$BUNDLER_EDITOR,$VISUAL, or$EDITOR. Picking your editor is such main character energy. π«Ά--bundleβ runbundle installafter creating the gem.--no-bundleβ do not runbundle installafter creating the gem.
π₯ SEE ALSO π₯
bundle config(1)bundle-config.1.html
And that's the whole page, bestie π this was written by the Bundler crew, shipped as part of the April 2026 release, and it lives under the name BUNDLE-GEM(1) in the General Commands Manual. Go generate something cute. πβ¨
π¦ where this page comes from
- centos-stream 10: ruby4.0 4.0.6-37.el10 Β· (Ruby OR BSD-2-Clause) AND (Ruby OR BSD-2-Clause OR GPL-1.0-or-later) AND BSD-3-Clause AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND ISC AND LicenseRef-Fedora-Public-Domain AND MIT AND CC0-1.0 AND zlib AND Unicode-DFS-2015 AND HPND-Markus-Kuhn AND Ruby-pty AND (Ruby OR BSD-2-Clause OR Python-2.0.1) AND BSD-2-Clause AND (Apache-2.0 OR BSL-1.0) AND GPL-2.0-only AND CC-BY-2.5 AND OFL-1.1-RFN AND BSL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms