Getting Started
Guides
Dependency Management
- How to manage application dependencies with Bundler
- How to manage dependencies with Bundler
- How to update gems with Bundler
- How to manage groups of gems
- How to install gems from git repositories
- Recommended Workflow with Version Control
- How to use Bundler with Ruby
- How to use Bundler in a single-file Ruby script
- How to deploy bundled applications
Gem Development
Publishing & Security
- Trusted Publishing
- Setting up multi-factor authentication
- Using multi-factor authentication in command line
- MFA requirement opt in
- Managing owners using UI
- Organizations
- Removing a Published gem
- Security Practices
Integrations
- How to use Bundler with Rails
- How to use Bundler with Sinatra
- How to use Bundler with Docker
- How to use Bundler with RubyMotion
Hosting & Sources
Extending
Troubleshooting
- How to troubleshoot RubyGems and Bundler TLS/SSL Issues
- SSL Certificate Update
- How to use git bisect with Bundler
Concepts
Reference
- gem Command Reference
- Bundler Command Reference
- Gemfile Reference
- Ruby Directive
- Specification Reference
- RubyGems.org API
- RubyGems.org API V2.0
- RubyGems.org Compact Index API
- RubyGems.org rate limits
- API key scopes
- Bundler compatibility with Ruby
- Known Bundler Plugins
Appendix
bundle gem
This reference was automatically generated from Bundler version 4.0.17.
bundle gem GEM_NAME OPTIONS
Description
Generates a directory named GEM_NAME with a Rakefile, GEM_NAME.gemspec,
and other supporting files and directories that can be used to develop a
rubygem with that name.
Run rake -T in the resulting project for a list of Rake tasks that can be used
to test and publish the gem to rubygems.org.
The generated project skeleton can be customized with OPTIONS, as explained below. Note that these options can also be specified via Bundler's global configuration file using the following names:
gem.cocgem.mitgem.test
Options
-
--exe,--bin,-b - Specify that Bundler should create a binary executable (as
exe/GEM_NAME) in the generated rubygem project. This binary will also be added to theGEM_NAME.gemspecmanifest. This behavior is disabled by default. --no-exe- Do not create a binary (overrides
--exespecified in the global config). --coc- Add a
CODE_OF_CONDUCT.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. --no-coc- Do not create a
CODE_OF_CONDUCT.md(overrides--cocspecified in the global config). --changelog- Add a
CHANGELOG.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. Update the default withbundle config set --global gem.changelog <true|false>. --no-changelog- Do not create a
CHANGELOG.md(overrides--changelogspecified in the global config). -
--ext=c,--ext=go,--ext=rust - Add boilerplate for C, Go (currently go-gem-wrapper based) or Rust (currently 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- Initialize a git repo inside your library.
--github-username=GITHUB_USERNAME- Fill in GitHub username on README so that you don't have to do it manually. Set a default with
bundle config set --global gem.github_username <your_username>. --mit- Add an MIT license to a
LICENSE.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 a
LICENSE.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 are
minitest,rspecandtest-unit. TheGEM_NAME.gemspecwill be configured and a skeleton test/spec directory 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. --no-test- Do not use a test framework (overrides
--testspecified in the global config). -
--ci,--ci=circle,--ci=github,--ci=gitlab - Specify the continuous integration service that Bundler should use when
generating the project. Acceptable values are
github,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. --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 are
rubocopandstandard. 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. --no-linter- Do not add a linter (overrides
--linterspecified in the global config). -
--edit=EDIT,-e=EDIT - Open the resulting GEM_NAME.gemspec in EDIT, or the default editor if not
specified. The default is
$BUNDLER_EDITOR,$VISUAL, or$EDITOR. --bundle- Run
bundle installafter creating the gem. --no-bundle- Do not run
bundle installafter creating the gem.