Rails asset precompliation
Hey, I have a pretty basic Rails app that I'm trying to deploy. Ever since the switch to nixpacks the builds fail, they used to work fine.
I was watching the build logs today and noticed this line:
#18 [stage-0 14/18] RUN bundle exec rake assets:procompile
#18 2.072 Did you mean? assets:precompile
So I opened up by codebase and did a search for procompile thinking I made a typo, but I can't find one anywhere.
Anyone else run into something like this?
My project id is a87e38b2-00d5-4aeb-bbde-7d8281cf6715
Solution:Jump to solution
I don't see the typo either, perhaps you have a build command set in the service settings?
33 Replies
Project ID:
a87e38b2-00d5-4aeb-bbde-7d8281cf6715
railway's nixpacks will try to determine what commands to run but it won't always get it right, you do have full control over what command gets run at any phase, so you can change that command
https://nixpacks.com/docs/configuration/file#commands
I mean, I don't think
bundle exec rake assets:procompile
is ever a valid command for Rails. According to the docs it will use the Ruby config if Gemfile
is detected, which it should be. And the docs say that the Build
command for ruby is bundle exec rake assets:precompile
, which is correct.
Is it possible I'm somehow using a version of nixpacks that had a bug that has since been fixed?it's more possible that nixpacks just doesn't have great support for rails
but the current nixpacks version in use by railway is 1.16.0 as of typing this, you can see the version your build uses by looking at the build table at the top of the build logs
hm, yeah it used the latest. I'm happy to add a config file I suppose.
Does the config file need to have config for each step of the build process, or can I let it use default for all the steps that work and just include
you only need to provide what you want changed
though that's already not valid
https://nixpacks.com/docs/guides/configuring-builds#custom-build-command
ah, the build phase only accepts
cmds
with an array of commands?I wouldn't say only, that's just the syntax
gonna also tag in @jr here
Thanks, I appreciate all of your help so far Brody. Clearly nixpacks is new to me.
no worries at all
Hm, still not working. Looks like it's still running the invalid command.
Here is my config: https://github.com/nicholaskillin/gameshelf/blob/master/nixpacks.toml
GitHub
gameshelf/nixpacks.toml at master · nicholaskillin/gameshelf
This app allows you to set up your game library (imports from Board Game Geek) and then share it with your friends. - nicholaskillin/gameshelf
Here is what I'm seeing in the build logs
can you send the full build logs? use this please https://bookmarklets.up.railway.app/log-downloader/
it's cut off, how about just a screenshot of the nixpacks build table?
looks like the build command is reflecting what you have in your nixpacks.toml file just fine?
Nope. The table shows
procompile
. My config says precompile
does that just mean there is a typo in nixpacks lol
I think so
I searched their repo and didn't see it, but that is what it seems like to me
To be fair, I've typed
procompile
on accident many times. I was sure this was my fault when I started. 🤣
I still don't see the typo in the nixpacks
repo. Perhaps the config lives in the docker image?Solution
I don't see the typo either, perhaps you have a build command set in the service settings?
Well 💩.
There it is. 🤣
no need for the nixpacks.toml file then
Hm, actually I can see it in the settings, but I'm not sure it's one I set or how to change it
ha, nevermind
Found it
🎉
damn what going on with your logs
rake should just support procompile
missed opportunity
Sounds more advanced than
precompile
🤣
My app is back up and running. Thanks again for helping me track down my own typo. I had a bad feeling when I first saw the logs that this was my fault somehow. 🤣
no prob, happy to help!