Bundler (Ruby)

consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. - Home

see also

Setup

Start by writing a Gemfile at the root of your ruby project you can use bundle init to do so.

# Gemfile
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rack', '~> 2.2.4'
gem 'rspec'

Then use Bundler to setup your dev environment

$ bundle install
$ git add Gemfile Gemfile.lock

.gemspec and Gemfile

VSCode

Override Vscode project so that it run bundle exec ruby when triggering Code Runner extension

# .vscode/settings.json
{
  "runner.commands": {
    "ruby": "bundle exec ruby"
  }
}
Written on January 27, 2025, Last update on June 14, 2025
ruby package build-system