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
- Managing owners using UI
- Organizations
- Removing a Published gem
- Security Practices
- How to delay new gem versions with cooldown
Integrations
- How to use Bundler with Rails
- How to use Bundler with Sinatra
- How to use Bundler with Docker
- How to use Bundler in CI
Hosting & Sources
Extending
Troubleshooting
- Troubleshooting common issues
- How to troubleshoot RubyGems and Bundler TLS/SSL Issues
- 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
How to use Bundler with Rails
Rails comes with baked-in support for Bundler.
How to use Bundler with Rails
Install Rails as you normally would. Use sudo if you would normally use sudo to install gems.
$ gem install rails
We recommend using rvm for dependable Ruby installations, especially if you are switching between different versions of Ruby
Generate a Rails app as usual
$ rails new myapp
$ cd myapp
Run the server. Bundler is transparently managing your dependencies!
$ rails server
Add new dependencies to your Gemfile as you need them.
gem 'nokogiri'
gem 'geokit'
If you want a dependency to be loaded only in a certain Rails environment, place it in a group named after that Rails environment
group :test do
gem 'rspec'
gem 'faker'
end
You can place a dependency in multiple groups at once as well
group :development, :test do
gem 'wirble'
gem 'ruby-debug'
end
After adding a dependency, if it is not yet installed, install it
$ bundle install
This will update all dependencies in your Gemfile to the latest versions that do not conflict with other dependencies