Help Installing Packages w/ Nixpacks
Hi all, I'm trying to use Nixpacks to install 'texliveSmall' so that I can deploy a Django web app through a github repo. In my railway.json file, I've used nixPkg to install it but when I try to use the app after deployment, it still cannot find the lualatex package, which I've verfied is in texliveSmall. Am I installing it correctly for my app to be able to use it? Here's a snippet of my railway.json file:
"$schema": "https://railway.app/railway.schema.json",
"setup": {
"nixPkgs": "texliveSmall"
},
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "cd layoutGenerator && python manage.py migrate && python manage.py collectstatic --noinput && gunicorn layoutGenerator.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
I am brand new to Railway (still in undergrad here) and would appreciate any help at all! I have tried nearly everything I can think of and still get the same error that the server cannot find the right file. I also do not know what project ID means but if someone lets me know what that's referring to, I will add it right away!!
Solution:Jump to solution
first, set your root directory to
/layoutGenerator
in the service settings, then put this railway.json file in that folder
```json
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {...55 Replies
Project ID:
c81346b6-183a-4331-af52-bc960a6108bf
project id: c81346b6-183a-4331-af52-bc960a6108bf
Solution
first, set your root directory to
/layoutGenerator
in the service settings, then put this railway.json file in that folder
Thanks so much. the current root directory contains my procfile, requirements.txt, and runtime.txt. should I move all of that too?
and should I delete the current railway.json?
maybe if you could share your repo i could get a better idea of what you got going on so i could give better informed advice?
it's an organizational repo for a school project so I'm not sure if you'll be able to see it. I'm still pretty new to all of this but lmk if you can see: https://github.com/SCCapstone/TheBackyardigans
i cant, can i see screenshots of it instead?
yes!
here is root:
and /layoutgenerator/:
bring the contents of
/layoutGenerator
into the root, then dont set any root directory in railway
then yes, replace your current railway.json with the one i gave youheard thanks so much - will it mess up my django file structure?
it shouldn’t
is it not possible to just set the root to /layoutgenerator and move the Railway files there too?
I appreciate your help, still trying to wrap my head around all this
i mean yeah, but why? if i may ask
having the manage.py (and accompanying structure) in the root of the project is more common than what you have now
example https://github.com/railwayapp-templates/django
gotcha okay. i'm not sure tbh - when linking to the HTML template files and the media directory and stuff within our Django app, I think there's a certain hierarchy with some references? but i'll have to double check.
just try what i suggested and fix whats broken
okay I will thank you
we have a huge deadline for deployment tomorrow though, that's why I was asking if it was possible to just set the root to layoutgenerator now and move the files just to see if i can deploy it asap and see if there are any issues. then in the future will restructure the directory to common practice
though that kinda of stuff should work with relative file paths so you arent depended on any rigid file structure
okay i got you i just was afraid to mess something up and not be able to fix it in time
i have a feeling that what i suggested will just work, and if youre worried about messing something up, well thats what github branches are for
yes you're right thank you so much for your patience lollll
of course
The build failed
let me send you the log hold on
the link won't add to my bookmarks
can I copy and paste or ss the log then i'll figure out how to add the bookmarklet?
i'm so sorry lol
yeah just copy paste the logs into a txt file yourself and then send here
just make sure you copy everything
thats not everything 😦
Omg
Not sure why it won't send the whole thing but the only thing missing is
Error: Docker build failed
might be worth it to give the bookmarklet another crack
I can't drag it to my bookmarks bar
why not?
open the link > click + drag
when I try to drag I just get this message
i'm on chrome
i too am on chrome
click and hold and drag the link to your bookmarks bar
then you open your build logs and click the bookmarklet
ugh i'm sorry i hate wasting your time because i can't figure out the bookmark thing, i will try again but in the meantime here's the bottom of the log which is where i see the errors occuring
okat let me try some things
hopefully this helps
ay you did it
yes hahah so sorry
still trying things
tysm
ive updated this, give it a try
untested though
it's been building for 7 minutes, is this normal?
not really
think we will have to move to a dockerfile based build to get this to work properly, if possible would it be possible for you to share your repo with me?
I don't have permissions unfortunately because it's owned by my prof
which files would you like to see?
it was successfully built after 9 minutes and is now deploying
well if it fails then we will talk more about the dockerfile
okay tysm
OMG it worked
I owe you my whole life
you just saved our whole project you have no idea.
i am on hour 4 of sitting in the same spot trying to get this dumb thing to work
youll have that with software dev 🤣
i cannot thank you enough!!
no problem!
have a blessed week seriously i am so appreciative! i hope yall get paid
you have a great week as well ❤️