Skip to content
Go to file

Latest commit

Windows Gemfile.lock uses `\r\n` instead of `\n` for newlines which can cause issues when matching regex. We are using regex to strip out BUNDLED WITH and were not previously handling windows Gemfile.lock by mistake.

There is other code that reads in the major version of BUNDLED WITH and it uses a read mode of `rt` which solves the problem.

The solution is to change this other location to also use a read mode of `rt`:

irb(main):009:0> !!"./spec/fixtures/windows_lockfile/Gemfile.lock").match(/^BUNDLED WITH$(\r?\n)   (?<major>\d+)\.\d+\.\d+/m)
=> false
irb(main):010:0> !!"./spec/fixtures/windows_lockfile/Gemfile.lock", mode: 'rt').match(/^BUNDLED WITH$(\r?\n)   (?<major>\d+)\.\d+
=> true

The test now also assert the desired behavior of removing BUNDLED WITH occurs.

Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Heroku Buildpack for Ruby


This is a Heroku Buildpack for Ruby, Rack, and Rails apps. It uses Bundler for dependency management.

This buildpack requires 64-bit Linux.



Example Usage:

$ ls
Gemfile Gemfile.lock

$ heroku create --buildpack heroku/ruby

$ git push heroku main
-----> Heroku receiving push
-----> Fetching custom buildpack
-----> Ruby app detected
-----> Installing dependencies using Bundler version 1.1.rc
       Running: bundle install --without development:test --path vendor/bundle --deployment
       Fetching gem metadata from
       Installing rack (1.3.5)
       Using bundler (1.1.rc)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Discovering process types
       Procfile declares types -> (none)
       Default types for Ruby  -> console, rake

The buildpack will detect your app as Ruby if it has a Gemfile and Gemfile.lock files in the root directory. It will then proceed to run bundle install after setting up the appropriate environment for ruby and Bundler.


For more information about using Ruby and buildpacks on Heroku, see these Dev Center articles:


To use this buildpack, fork it on Github. Push up changes to your fork, then create a test app with --buildpack <your-github-url> and push to it.


The tests on this buildpack are written in Rspec to allow the use of focused: true. Parallelization of testing is provided by this lib spins up an arbitrary number of processes and running a different test file in each process, it does not parallelize tests within a test file. To run the tests: clone the repo, then bundle install then clone the test fixtures by running:

$ bundle exec hatchet install
$ bundle exec rake spec
You can’t perform that action at this time.