Trying to deploy a Rails 6.x app and having Yarn issues.

I have managed to launch the app and get the database built but when I got to deploy I am getting messages that Yarn is not installed. Yarn and Webpacker are both installed locally and working fine.

Here is the error text…

[stage-4 8/8] RUN bin/rails fly:build:
#26 3.520 Volta error: Yarn is not available.
#26 3.520
#26 3.520 Use volta install yarn to select a default version (see volta help install for more info).
#26 3.849 Volta error: Yarn is not available.
#26 3.849
#26 3.849 Use volta install yarn to select a default version (see volta help install for more info).
#26 3.925 I, [2022-09-19T19:23:11.116217 #1] INFO – : Writing /app/public/assets/error-156d4702ea339f07f4afcf1b3a8376da763dea6f9dc6461f2602c8d3c6371a84.png
#26 3.925 I, [2022-09-19T19:23:11.116891 #1] INFO – : Writing /app/public/assets/gritter-close-b45e4e3265c1091c50b3531a5a7a21b726b397adb6ca081d82797e0d29165781.png
#26 3.926 I, [2022-09-19T19:23:11.117805 #1] INFO – : Writing /app/public/assets/gritter-84f45eb6efbd0f9313e3cf0d81dcea4cbb2ed8552c6babeca799f71a8d879213.png
#26 3.927 I, [2022-09-19T19:23:11.118638 #1] INFO – : Writing /app/public/assets/ie-spacer-c404c6ad7ced964722cc14635cc2e0a5b924b13c4120c02e51f6d16d39553c3a.gif
#26 3.928 I, [2022-09-19T19:23:11.119561 #1] INFO – : Writing /app/public/assets/notice-e348463c1fa5eabe612eb21ac03b550b5e9278df27b26dc21d745205c1fd9bee.png
#26 3.928 I, [2022-09-19T19:23:11.119813 #1] INFO – : Writing /app/public/assets/progress-4401130d700faadafe42bf322264e2689dae9ded22c1186c38ad2699d28b9715.gif
#26 3.928 I, [2022-09-19T19:23:11.120129 #1] INFO – : Writing /app/public/assets/success-abc60b9ec6e86a3254ee885da0f04a6d2b9c68e044ee5976710d7b8bf8fdddc3.png
#26 3.929 I, [2022-09-19T19:23:11.120378 #1] INFO – : Writing /app/public/assets/warning-c8acc23f866cdb032492373cc343f0121f867e0eb28f5efe1c0b0de71371133c.png
#26 3.929 I, [2022-09-19T19:23:11.120605 #1] INFO – : Writing /app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js
#26 3.929 I, [2022-09-19T19:23:11.120757 #1] INFO – : Writing /app/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js.gz
#26 3.929 I, [2022-09-19T19:23:11.120959 #1] INFO – : Writing /app/public/assets/favicon-99f7ffd3b4b4f5f0dc6803372c4e1f1a3347e305d56651e29879f5a66c622f5a.ico
#26 3.931 I, [2022-09-19T19:23:11.122137 #1] INFO – : Writing /app/public/assets/favicon-99f7ffd3b4b4f5f0dc6803372c4e1f1a3347e305d56651e29879f5a66c622f5a.ico.gz
#26 3.931 I, [2022-09-19T19:23:11.122682 #1] INFO – : Writing /app/public/assets/programmer-e0e84c7fb09cf1e99f4639229eac577fd631a4c88f1074f73f6769382f7a8849.jpg
#26 3.932 I, [2022-09-19T19:23:11.123141 #1] INFO – : Writing /app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 3.932 I, [2022-09-19T19:23:11.123516 #1] INFO – : Writing /app/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 3.932 I, [2022-09-19T19:23:11.123809 #1] INFO – : Writing /app/public/assets/contacts-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 3.932 I, [2022-09-19T19:23:11.124060 #1] INFO – : Writing /app/public/assets/contacts-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 3.933 I, [2022-09-19T19:23:11.124314 #1] INFO – : Writing /app/public/assets/portfolio-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
#26 3.933 I, [2022-09-19T19:23:11.124519 #1] INFO – : Writing /app/public/assets/portfolio-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
#26 3.957 Volta error: Yarn is not available.
#26 3.957
#26 3.957 Use volta install yarn to select a default version (see volta help install for more info).
#26 3.959 Yarn not installed. Please download and install Yarn from Installation | Yarn
#26 3.959 Exiting!


Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c ${BUILD_COMMAND}]: exit code: 1

Any help would be appreciated.
Mike

Make a one line fix to your Dockerfile and you should be up and running.

Before:

RUN volta install node@${NODE_VERSION}

After:

RUN volta install node@${NODE_VERSION} yarn

I’ll fix flyctl to generate a correct Dockerfile handing this case going forward.

1 Like