Replies: 2 comments 3 replies
-
Hi there! Comparing the Hatchbox deploy script, and the output log you provided:
suggests that Hatchbox is doing something else to detect the task. I'd suggest following up with Hatchbox to understand how they are checking if the task is defined. Perhaps they are checking for specific gems, like |
Beta Was this translation helpful? Give feedback.
-
Hey @ElMassimo! You are absolutely right. I just received the following message from Chris Oliver:
I'm new to Ruby on Rails and thought
Can it be safely uncommented? That would apparently provide the immediate fix. Or maybe his other suggestion might be a more lean way of triggering the precompile step. I guess I need to put a file under the lib/tasks folder in my rails app in that case. |
Beta Was this translation helpful? Give feedback.
-
I have been using Heroku which works with Vite Ruby out of the box. I tried out Hatchbox the other day and noticed that it skips the precompilation step when deploying:
-----> [Skip] assets:precompile task not detected
While on Heroku it does detect the task:
-----> Detecting rake tasks -----> Preparing app for Rails asset pipeline Running: rake assets:precompile
At first I thought there was a bug as Chris Oliver, the creator of Hatchbox states that the default deploy does in fact run the needed precompile task. So I opened a ticket but got the following answer:
Hatchbox does precompile the assets but not if it is skipped due to a change in the basic Rails setup. It is possible that Vite or something else is causing Hatchbox to skip that step. If you change that Hatchbox will precompile them for you.
Now I am wondering what needs to be adjusted exactly. I looked up the source code here https://github.com/ElMassimo/vite_ruby/blob/main/vite_ruby/lib/tasks/vite.rake but I'm unsure whether there's anything being adjusted in the Rails setup itself as the answer states.
Curious to know what needs to be changed for the assets:precompile task to be executed automatically just like on Heroku.
Best regards
Beta Was this translation helpful? Give feedback.
All reactions