Skip to content

Commit 79ad8d7

Browse files
authored
Improve message on bin/detect failure (heroku#1647)
Include the list of files in the root directory in the output.
1 parent 0d774f0 commit 79ad8d7

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Improve message on `bin/detect` failure to include the list of files in the root directory (https://github.com/heroku/heroku-buildpack-ruby/pull/1647)
56

67
## [v322] - 2025-09-29
78

bin/detect

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ APP_DIR=$1
77
if [ -f "$APP_DIR/Gemfile" ]; then
88
echo "Ruby"
99
exit 0
10-
else
11-
exit 1
1210
fi
11+
12+
output::error <<EOF
13+
Error: Your app is configured to use the Ruby buildpack,
14+
but we couldn't find any supported Ruby project files ('Gemfile.lock').
15+
16+
A Ruby app on Heroku must have a 'Gemfile.lock' in the root directory of its source code.
17+
18+
Currently the root directory of your app contains:
19+
20+
$(ls -1A --indicator-style=slash "${BUILD_DIR}" || true)
21+
22+
If your app already has a package manager file, check that it:
23+
24+
1. Is in the top level directory (not a subdirectory).
25+
2. Has the correct spelling (the filenames are case-sensitive).
26+
3. Isn't listed in '.gitignore' or '.slugignore'.
27+
4. Has been added to the Git repository using 'git add --all'
28+
and then committed using 'git commit'.
29+
30+
Otherwise, add a package manager file to your app. If your app has
31+
no dependencies, then create an empty 'Gemfile', run 'bundle install' and
32+
commit the results to git.
33+
34+
For help with using Ruby on Heroku, see:
35+
https://devcenter.heroku.com/articles/getting-started-with-ruby
36+
https://devcenter.heroku.com/articles/ruby-support
37+
EOF
38+
39+
exit 1

0 commit comments

Comments
 (0)