I am attempting to build this guide with pack and the latest heroku-24 builder and I encountered a detecting rake tasks error. This error is occurring because the image being built by pack on this repo does not have a javascript run time, as indicated by an ExecJS warning.
Full error:
[builder] ! Error detecting rake tasks
[builder] !
[builder] ! The Ruby buildpack uses rake task information from your application to guide
[builder] ! build logic. Without this information, the Ruby buildpack cannot continue.
[builder] !
[builder] ! Ensure you can run the following command locally with no errors before attempting another build:
[builder] !
[builder] ! `bundle exec rake -P --trace`
[builder] !
[builder] !
[builder] !
[builder] ! Use the information above to debug further.
[builder]
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
ExecJS warning:
[builder] - Debug info
[builder] - Command failed `bundle exec rake -P --trace`
[builder] exit status: 1
[builder] stdout: <empty>
[builder] stderr: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[builder] rake aborted!
[builder] ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
This image is using the jvm, ruby, and procfile buildpacks:
This issue does not occur on heroku classic build because a default node version is installed with a warning:
remote: ###### WARNING:
remote:
remote: Installing a default version (20.9.0) of Node.js.
remote: This version is not pinned and can change over time, causing unexpected failures.
remote:
remote: Heroku recommends placing the `heroku/nodejs` buildpack in front of
remote: `heroku/ruby` to install a specific version of node:
remote:
remote: https://devcenter.heroku.com/articles/ruby-support#node-js-support
Full build output below
$ pack build jruby-app --builder heroku/builder:24
24: Pulling from heroku/builder
Digest: sha256:2fde8c9301ca4ae0063c7bc78fd2439aa1f3a6d0a3a2764ba721fbc677327f5f
Status: Image is up to date for heroku/builder:24
24: Pulling from heroku/heroku
Digest: sha256:09851f0d8c298913aa8e441c9139d5645d281b120525379430013317bcc253db
Status: Image is up to date for heroku/heroku:24
0.19.7: Pulling from buildpacksio/lifecycle
Digest: sha256:5e6fd54be3f51b21cfea19a47ccecc38a576f4dcfe1497f296fe6859a90c2212
Status: Image is up to date for buildpacksio/lifecycle:0.19.7
===> ANALYZING
[analyzer] Image with name "jruby-app" not found
===> DETECTING
[detector] 3 of 5 buildpacks participating
[detector] heroku/jvm 6.0.0
[detector] heroku/ruby 3.0.0
[detector] heroku/procfile 3.1.1
===> RESTORING
===> BUILDING
[builder]
[builder] [Warning: No OpenJDK version specified]
[builder] Your application does not explicitly specify an OpenJDK version. The latest
[builder] long-term support (LTS) version will be installed. This currently is OpenJDK 21.
[builder]
[builder] This default version will change when a new LTS version is released. Your
[builder] application might fail to build with the new version. We recommend explicitly
[builder] setting the required OpenJDK version for your application.
[builder]
[builder] To set the OpenJDK version, add or edit the system.properties file in the root
[builder] directory of your application to contain:
[builder]
[builder] java.runtime.version = 21
[builder]
[builder]
[builder] [Installing OpenJDK 21.0.3]
[builder]
[builder] # Heroku Ruby Buildpack
[builder]
[builder] - Metrics agent
[builder] - Skipping install (`barnes` gem not found)
[builder] - Ruby version `3.1.0-jruby-9.4.1.0` from `Gemfile.lock`
[builder] - Installing ..... (2.738s)
[builder] - Bundler version `2.4.7` from `Gemfile.lock`
[builder] - Running `gem install bundler --version 2.4.7` ........... (8.144s)
[builder] - Bundle install
[builder] - Running `BUNDLE_BIN="/layers/heroku_ruby/gems/bin" BUNDLE_CLEAN="1" BUNDLE_DEPLOYMENT="1" BUNDLE_GEMFILE="/workspace/Gemfile" BUNDLE_PATH="/layers/heroku_ruby/gems" BUNDLE_WITHOUT="development:test" bundle install`
[builder]
[builder] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[builder] Fetching gem metadata from https://rubygems.org/.........
[builder] Fetching rake 13.0.6
[builder] Installing rake 13.0.6
[builder] Fetching concurrent-ruby 1.2.2
[builder] Fetching erubi 1.12.0
[builder] Fetching builder 3.2.4
[builder] Fetching minitest 5.18.0
[builder] Fetching crass 1.0.6
[builder] Fetching racc 1.6.2 (java)
[builder] Fetching rack 2.2.6.4
[builder] Fetching nio4r 2.5.9 (java)
[builder] Fetching marcel 1.0.2
[builder] Fetching websocket-extensions 0.1.5
[builder] Fetching date 3.3.3 (java)
[builder] Fetching jdbc-postgres 42.2.25
[builder] Using bundler 2.4.7
[builder] Fetching mini_mime 1.1.2
[builder] Fetching timeout 0.3.2
[builder] Fetching coffee-script-source 1.12.2
[builder] Fetching msgpack 1.6.1 (java)
[builder] Installing date 3.3.3 (java)
[builder] Installing timeout 0.3.2
[builder] Installing builder 3.2.4
[builder] Installing crass 1.0.6
[builder] Installing websocket-extensions 0.1.5
[builder] Fetching execjs 2.8.1
[builder] Installing mini_mime 1.1.2
[builder] Installing racc 1.6.2 (java)
[builder] Installing erubi 1.12.0
[builder] Fetching method_source 1.0.0
[builder] Fetching thor 1.2.1
[builder] Installing coffee-script-source 1.12.2
[builder] Installing minitest 5.18.0
[builder] Installing marcel 1.0.2
[builder] Installing nio4r 2.5.9 (java)
[builder] Installing rack 2.2.6.4
[builder] Installing msgpack 1.6.1 (java)
[builder] Fetching zeitwerk 2.6.7
[builder] Fetching ffi 1.15.5 (java)
[builder] Using jar-dependencies 0.4.1
[builder] Fetching rb-fsevent 0.11.2
[builder] Fetching tilt 2.1.0
[builder] Installing concurrent-ruby 1.2.2
[builder] Fetching turbolinks-source 5.2.0
[builder] Fetching net-protocol 0.2.1
[builder] Fetching websocket-driver 0.7.5 (java)
[builder] Installing method_source 1.0.0
[builder] Installing execjs 2.8.1
[builder] Using psych 5.1.0 (java)
[builder] Installing zeitwerk 2.6.7
[builder] Fetching bootsnap 1.16.0
[builder] Fetching rdoc 6.5.0
[builder] Installing turbolinks-source 5.2.0
[builder] Installing thor 1.2.1
[builder] Installing tilt 2.1.0
[builder] Fetching coffee-script 2.4.1
[builder] Fetching nokogiri 1.14.3 (java)
[builder] Fetching puma 6.3.1 (java)
[builder] Installing net-protocol 0.2.1
[builder] Fetching uglifier 4.2.0
[builder] Installing ffi 1.15.5 (java)
[builder] Installing websocket-driver 0.7.5 (java)
[builder] Fetching turbolinks 5.2.1
[builder] Installing rb-fsevent 0.11.2
[builder] Installing coffee-script 2.4.1
[builder] Installing jdbc-postgres 42.2.25
[builder] Fetching net-imap 0.3.4
[builder] Fetching net-pop 0.1.2
[builder] Installing bootsnap 1.16.0 with native extensions
[builder] Fetching net-smtp 0.3.3
[builder] Installing puma 6.3.1 (java)
[builder] Installing turbolinks 5.2.1
[builder] Installing rdoc 6.5.0
[builder] Installing uglifier 4.2.0
[builder] Fetching rack-test 2.1.0
[builder] Fetching i18n 1.12.0
[builder] Fetching tzinfo 2.0.6
[builder] Installing net-smtp 0.3.3
[builder] Fetching sprockets 4.2.0
[builder] Installing net-pop 0.1.2
[builder] Installing net-imap 0.3.4
[builder] Fetching sassc 2.4.0
[builder] Fetching rb-inotify 0.10.1
[builder] Installing rack-test 2.1.0
[builder] Fetching mail 2.8.1
[builder] Installing i18n 1.12.0
[builder] Installing tzinfo 2.0.6
[builder] Installing sprockets 4.2.0
[builder] Installing rb-inotify 0.10.1
[builder] Fetching activesupport 7.0.4.3
[builder] Installing sassc 2.4.0 with native extensions
[builder] Fetching listen 3.8.0
[builder] Fetching sdoc 2.6.1
[builder] Installing mail 2.8.1
[builder] Installing nokogiri 1.14.3 (java)
[builder] Installing listen 3.8.0
[builder] Installing activesupport 7.0.4.3
[builder] Installing sdoc 2.6.1
[builder] Fetching globalid 1.1.0
[builder] Fetching activemodel 7.0.4.3
[builder] Fetching loofah 2.19.1
[builder] Fetching rails-dom-testing 2.0.3
[builder] Installing globalid 1.1.0
[builder] Installing rails-dom-testing 2.0.3
[builder] Installing loofah 2.19.1
[builder] Installing activemodel 7.0.4.3
[builder] Fetching activejob 7.0.4.3
[builder] Fetching rails-html-sanitizer 1.5.0
[builder] Installing activejob 7.0.4.3
[builder] Installing rails-html-sanitizer 1.5.0
[builder] Fetching activerecord 7.0.4.3
[builder] Fetching actionview 7.0.4.3
[builder] Installing actionview 7.0.4.3
[builder] Installing activerecord 7.0.4.3
[builder] Fetching jbuilder 2.11.5
[builder] Fetching actionpack 7.0.4.3
[builder] Installing jbuilder 2.11.5
[builder] Installing actionpack 7.0.4.3
[builder] Fetching sprockets-rails 3.4.2
[builder] Fetching actioncable 7.0.4.3
[builder] Fetching actionmailer 7.0.4.3
[builder] Fetching railties 7.0.4.3
[builder] Fetching activerecord-jdbc-adapter 70.1 (java)
[builder] Fetching activestorage 7.0.4.3
[builder] Installing sprockets-rails 3.4.2
[builder] Installing actioncable 7.0.4.3
[builder] Installing actionmailer 7.0.4.3
[builder] Installing activestorage 7.0.4.3
[builder] Installing railties 7.0.4.3
[builder] Installing activerecord-jdbc-adapter 70.1 (java)
[builder] Fetching actionmailbox 7.0.4.3
[builder] Fetching actiontext 7.0.4.3
[builder] Installing actionmailbox 7.0.4.3
[builder] Installing actiontext 7.0.4.3
[builder] Fetching activerecord-jdbcpostgresql-adapter 70.1 (java)
[builder] Installing activerecord-jdbcpostgresql-adapter 70.1 (java)
[builder] Fetching jquery-rails 4.5.1
[builder] Fetching coffee-rails 5.0.0
[builder] Fetching rails 7.0.4.3
[builder] Installing coffee-rails 5.0.0
[builder] Installing rails 7.0.4.3
[builder] Installing jquery-rails 4.5.1
[builder] Fetching sassc-rails 2.1.2
[builder] Installing sassc-rails 2.1.2
[builder] Fetching sass-rails 6.0.0
[builder] Installing sass-rails 6.0.0
[builder] Bundle complete! 13 Gemfile dependencies, 74 gems now installed.
[builder] Gems in the groups 'development' and 'test' were not installed.
[builder] Bundled gems are installed into `/layers/heroku_ruby/gems`
[builder]
[builder] - Done (1m 21s)
[builder] - Setting default processes
[builder] - Running `bundle list` ....... (4.482s)
[builder] - Detected rails app (`rails` gem found)
[builder] - Rake assets install
[builder] - Detected rake (`rake` gem found, `Rakefile` found at `/workspace/Rakefile`)
[builder] - Running `bundle exec rake -P --trace` ............. (10.277s)
[builder] - Debug info
[builder] - Command failed `bundle exec rake -P --trace`
[builder] exit status: 1
[builder] stdout: <empty>
[builder] stderr: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[builder] rake aborted!
[builder] ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/execjs-2.8.1/lib/execjs/runtimes.rb:58:in `autodetect'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/execjs-2.8.1/lib/execjs.rb:5:in `<module:ExecJS>'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/execjs-2.8.1/lib/execjs.rb:4:in `<main>'
[builder] org/jruby/RubyKernel.java:1057:in `require'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/uglifier-4.2.0/lib/uglifier.rb:5:in `<main>'
[builder] org/jruby/RubyKernel.java:1057:in `require'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/runtime.rb:60:in `block in require'
[builder] org/jruby/RubyArray.java:1988:in `each'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/runtime.rb:55:in `block in require'
[builder] org/jruby/RubyArray.java:1988:in `each'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/runtime.rb:44:in `require'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler.rb:195:in `require'
[builder] /workspace/config/application.rb:7:in `<main>'
[builder] org/jruby/RubyKernel.java:1057:in `require'
[builder] /workspace/Rakefile:4:in `<main>'
[builder] org/jruby/RubyKernel.java:1091:in `load'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
[builder] org/jruby/RubyKernel.java:1091:in `load'
[builder] /layers/heroku_ruby/gems/jruby/3.1.0/bin/rake:25:in `<main>'
[builder] org/jruby/RubyKernel.java:1091:in `load'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:23:in `run'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/cli.rb:492:in `exec'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/cli.rb:34:in `dispatch'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/cli.rb:28:in `start'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/exe/bundle:45:in `block in <main>'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
[builder] /layers/heroku_ruby/bundler/gems/bundler-2.4.7/exe/bundle:33:in `<main>'
[builder] org/jruby/RubyKernel.java:1091:in `load'
[builder] /layers/heroku_ruby/gems/bin/bundle:108:in `<main>'
[builder]
[builder]
[builder] ! Error detecting rake tasks
[builder] !
[builder] ! The Ruby buildpack uses rake task information from your application to guide
[builder] ! build logic. Without this information, the Ruby buildpack cannot continue.
[builder] !
[builder] ! Ensure you can run the following command locally with no errors before attempting another build:
[builder] !
[builder] ! `bundle exec rake -P --trace`
[builder] !
[builder] !
[builder] !
[builder] ! Use the information above to debug further.
[builder]
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
I am attempting to build this guide with pack and the latest heroku-24 builder and I encountered a
detecting rake tasks
error. This error is occurring because the image being built by pack on this repo does not have a javascript run time, as indicated by an ExecJS warning.Full error:
ExecJS warning:
This image is using the jvm, ruby, and procfile buildpacks:
This issue does not occur on heroku classic build because a default node version is installed with a warning:
Full build output below