# Rails precompile fails due to missing ExecJS runtime

**URL:** <https://community.fly.io/t/rails-precompile-fails-due-to-missing-execjs-runtime/8383>\
**Category:** Build debugging\
**Tags:** rails\
**Created:** [November 1, 2022, 10:36pm UTC](https://community.fly.io/t/rails-precompile-fails-due-to-missing-execjs-runtime/8383 "2022-11-01T22:36:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![latortuga](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/latortuga/32/6750_2.png) [@latortuga](https://community.fly.io/u/latortuga)\
**Post date:** [November 1, 2022, 10:36pm UTC](https://community.fly.io/t/rails-precompile-fails-due-to-missing-execjs-runtime/8383/1 "2022-11-01T22:36:31Z")

</div>

I used the Turboku launcher for my Heroku-hosted Rails app and it worked great - my app deployed and it works! However, I cannot deploy anymore. I get the following during build:

```auto
 > [stage-3 7/7] RUN bin/rails fly:build:
#20 3.527 rails aborted!
#20 3.527 ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
#20 3.527 /app/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
#20 3.527 /app/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
#20 3.527 /app/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<main>'

```

This is telling me that ExecJS is trying to precompile my assets and cannot find a runtime to do that. Question 1: why did this work when using Turboku but does not anymore? Question 2: how can I fix this?

---

<div class="post-metadata">

**Author:** ![pulleasy](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/pulleasy/32/7087_2.png) [@pulleasy](https://community.fly.io/u/pulleasy)\
**Post date:** [November 15, 2022, 11:27am UTC](https://community.fly.io/t/rails-precompile-fails-due-to-missing-execjs-runtime/8383/2 "2022-11-15T11:27:04Z")

</div>

I’m currently migrating old Rails apps from Heroku to fly and find a solution.

You can add `nodejs` to `DEPLOY_PACKAGES` within the `Dockerfile` to fix the missing ExecJS runtime.
