# Rails app \`fly deploy\` failing with ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime

**URL:** <https://community.fly.io/t/rails-app-fly-deploy-failing-with-execjs-could-not-find-a-javascript-runtime/7904>\
**Category:** Build debugging\
**Tags:** rails\
**Created:** [October 16, 2022, 8:25pm UTC](https://community.fly.io/t/rails-app-fly-deploy-failing-with-execjs-could-not-find-a-javascript-runtime/7904 "2022-10-16T20:25:49Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![stevec](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@stevec](https://community.fly.io/u/stevec)\
**Post date:** [January 11, 2023, 5:44am UTC](https://community.fly.io/t/rails-app-fly-deploy-failing-with-execjs-could-not-find-a-javascript-runtime/7904/11 "2023-01-11T05:44:48Z")

</div>

I had the same problem.

I solved by adding this to the dockerfile, **and** making sure I added it just before the line containing `fly:build` (adding it earlier in the Dockerfile produced the same error).

```plaintext
RUN apt-get update
RUN apt-get install nodejs -y

```

Hope it helps.

---

_[View the full topic](https://community.fly.io/t/rails-app-fly-deploy-failing-with-execjs-could-not-find-a-javascript-runtime/7904)._
