R
Railway12mo ago
rose

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:
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": {...
Jump to solution
55 Replies
Percy
Percy12mo ago
Project ID: c81346b6-183a-4331-af52-bc960a6108bf
rose
roseOP12mo ago
project id: c81346b6-183a-4331-af52-bc960a6108bf
Solution
Brody
Brody12mo ago
first, set your root directory to /layoutGenerator in the service settings, then put this railway.json file in that folder
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"phases": {
"setup": {
"aptPkgs": ["...", "texlive-full", "texlive-luatex"]
}
}
}
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn layoutGenerator.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"phases": {
"setup": {
"aptPkgs": ["...", "texlive-full", "texlive-luatex"]
}
}
}
},
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn layoutGenerator.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
rose
roseOP12mo ago
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?
Brody
Brody12mo ago
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?
rose
roseOP12mo ago
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
Brody
Brody12mo ago
i cant, can i see screenshots of it instead?
rose
roseOP12mo ago
yes!
rose
roseOP12mo ago
here is root:
No description
rose
roseOP12mo ago
and /layoutgenerator/:
No description
Brody
Brody12mo ago
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 you
rose
roseOP12mo ago
heard thanks so much - will it mess up my django file structure?
Brody
Brody12mo ago
it shouldn’t
rose
roseOP12mo ago
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
Brody
Brody12mo ago
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
rose
roseOP12mo ago
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.
Brody
Brody12mo ago
just try what i suggested and fix whats broken
rose
roseOP12mo ago
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
Brody
Brody12mo ago
though that kinda of stuff should work with relative file paths so you arent depended on any rigid file structure
rose
roseOP12mo ago
okay i got you i just was afraid to mess something up and not be able to fix it in time
Brody
Brody12mo ago
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
rose
roseOP12mo ago
yes you're right thank you so much for your patience lollll
Brody
Brody12mo ago
of course
rose
roseOP12mo ago
The build failed let me send you the log hold on
rose
roseOP12mo ago
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
Brody
Brody12mo ago
yeah just copy paste the logs into a txt file yourself and then send here just make sure you copy everything
rose
roseOP12mo ago
Brody
Brody12mo ago
thats not everything 😦
rose
roseOP12mo ago
rose
roseOP12mo ago
Omg Not sure why it won't send the whole thing but the only thing missing is Error: Docker build failed
Brody
Brody12mo ago
might be worth it to give the bookmarklet another crack
rose
roseOP12mo ago
I can't drag it to my bookmarks bar
Brody
Brody12mo ago
why not? open the link > click + drag
rose
roseOP12mo ago
when I try to drag I just get this message
No description
rose
roseOP12mo ago
i'm on chrome
Brody
Brody12mo ago
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
rose
roseOP12mo ago
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
No description
No description
No description
No description
Brody
Brody12mo ago
okat let me try some things
rose
roseOP12mo ago
hopefully this helps
Brody
Brody12mo ago
ay you did it
rose
roseOP12mo ago
yes hahah so sorry
Brody
Brody12mo ago
still trying things
rose
roseOP12mo ago
tysm
Brody
Brody12mo ago
ive updated this, give it a try untested though
rose
roseOP12mo ago
it's been building for 7 minutes, is this normal?
Brody
Brody12mo ago
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?
rose
roseOP12mo ago
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
Brody
Brody12mo ago
well if it fails then we will talk more about the dockerfile
rose
roseOP12mo ago
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
Brody
Brody12mo ago
youll have that with software dev 🤣
rose
roseOP12mo ago
i cannot thank you enough!!
Brody
Brody12mo ago
no problem!
rose
roseOP12mo ago
have a blessed week seriously i am so appreciative! i hope yall get paid
Brody
Brody12mo ago
you have a great week as well ❤️
Want results from more Discord servers?
Add your server