Trying to migrate from Heroku
I am trying to migrate our Rails project over from Heroku. I have followed the migration guide and believe everything set itself up "automagically", but deploys are failing and I am really struggling to understand why, or understand how to gain any control over the situation to resolve.
I will attach a screenshot of the deploy logs as well as our build settings.
Project ID: dbb32a7b-e126-450a-89f1-55383bcf99b8
99 Replies
Project ID:
dbb32a7b-e126-450a-89f1-55383bcf99b8
Not incredibly experienced in this category and I could be wrong; however you can try to ensure your bundler gem version is the most recent version: For example, you can change gem 'bundler', '2.1.4' to gem 'bundler', '>= 2.1.4'. Then run bundle update bundler locally to update your Gemfile.lock.
Heroku is holds your hand with your code and its deployment, while Railway executes your deployments as-is, so any minor changes like this could affect it.
Thanks. I have tried running
railway run gem install bundler:2.1.4
and indeed when i run railway run gem list
, bundler 2.1.4
is now listed. However I'm still getting the exact same error on deploy 🤔If you have already installed bundler version 2.1.4 using the railway run gem install bundler:2.1.4 command, but you are still encountering the same error during deployment, there might be a few other things to consider:
1. Check your Gemfile: Make sure that your Gemfile specifies the required bundler version as gem 'bundler', '>= 2.1.4'. Verify that there are no conflicting gem versions or other issues in your Gemfile.
2. Run bundle update bundler: Locally, run the command bundle update bundler to update your Gemfile.lock and ensure that the correct bundler version is locked in.
3. Verify the Dockerfile: Confirm that your Dockerfile is correctly configured to install the specified bundler version. The Dockerfile should contain a line like RUN gem install bundler -v '>= 2.1.4'.
Sigh, I actually did not realize this project had a Dockerfile, but just found it. It's old and totally outdated. I want to just remove it and see if Railway can deploy without specifying one?
However, now when trying to deploy with
railway up
, im getting "The owner of this project is not verified". Any ideas here? Sorry this request is now taking a tangent, but i wasn't experiencing this issue previously.Absolutely no worries; have you received any verification emails regarding verifying your email/account? and/or linking your GitHub account to Railway if you have one?
I'm actually not the owner of the GH repo, but I believe he did verify it a few days ago. But i'll check with him. Thanks
Oh hmm, didn’t know that the owner of the project had to be verified. Are you using codespaces or the cli installed on your computer with a local directory?
And of course, feel free to reach out with any other questions or concerns.
Yea im using CLI
Oh, are you using a shared project shared by your friend?
that's right
Ah, makes sense.
are we "doing it wrong"? 😅
Sorry for the confusion.
Nope, just gotta make sure he’s verified I’m assuming, tell him to check out his email and see if he ever got any verifications emails or messages in settings, haha.
copy
Alright, so i've asked the GH account owner to look and he doesn't see any additional emails asking for account verification. He had already successfully verified the account previously, it just stopped "working" somewhere along the lines. Is there any way to re-initialize that process?
Anyone…?
Did you push those changes to your gem lockfile etc.?
railway run
runs the command with envs from Railway injected. It means "run this command locally using my Railway variables" instead of "run this command on my service on Railway"I did but cannot deploy due to the aforementioned account verification issue
Hmm ok; trying to process what that means practically 🤔
Try again
What is the proper way then to deploy a different branch? ‘git checkout somebranch’, ‘railway up’?
I overrode the verification for your project owner
mmmm, I'd recommend sticking the project on GitHub and connecting that to your Railway service in that case
because you'd ideally want that different branch to be on a different environment in Railway
if you do
railway up
that way, it's going to push to whichever environment your CLI is set to (production by default)
(which means there's a chance your some-shiny-wip-feature
branch gets pushed to your app's production)hm, obviously we'd always want our production environment to be pointed to
master
, but we want to also have a staging environment which could have any number of branches pointed at it; surely we wouldn't need to create a different environment for each branch?
well, as far as my initial question, this build seems to be more promising now that i've removed our crappy Dockerfile 👍Nope! If you enable PR deploys for your project, we'll spin up a different environment for each pull request you have. But that flow is entirely based on what you push to GitHub, not locally via CLI
hmm, we have dozens of branches though. surely that would incur a prohibitive cost once we get our evironments fully up and running?
🙌
They're pull requests based. When you open a new PR, the env gets spun up. When you merge/close a PR, they get deleted 🙂
Let me share an example, one sec
mm word ok. i'll need to give that a think
https://github.com/railwayapp/docs/pull/304 see this? There's a PR environment available at its own URL.
https://docs.railway.app/develop/services#docker-image is our production, https://railway-docs-docs-pr-304.up.railway.app/develop/services#docker-image gets changed in that PR. The environment gets created in Railway when the PR is opened, and it gets automatically deleted once I merge that into master.
interesting. but for instance, in our current setup on Heroku, we'd maintain our staging environment database with a copy of production data; how would that happen in these PR environments if they are just spinning up from scratch each time?
you can maintain that staging environment manually, and point your PR environments to use your staging environment's database connection string
kk
is what you'd see for PR environment settings. Change the base environment to your staging and it should work 🙂
ok
so this build got far further along than we've made it so far, but at the risk of being a pain now, there's a problem it encountered, and I'm not quite sure how to go about resolving. This isn't something we've encountered locally, and in any case I'm not sure how i'd go about resolving something on Railway's end...?
not sure if it's an issue with the Nixpack or what exactly 🧐
Wanna post the error here? Others will be able to jump in to help 🙂
sorry yea
@rayofbytes curious, are you guys seeing an influx of Heroku refugees?
lots for a multitude of reasons...
figured. yea Salesforce has clearly already laid Heroku in a casket; just haven't closed the lid just yet
Railway seemed like the next-best alternative. I'm still in the learning curve of trying to understand how they differ; being totally honest it's not quite the experience i was hoping for, but im sure i need to give it some more time and get everything up and running properly before making a judgment call. anyways, i appreaciate the assistance.
We ❤️ candid feedback. What's lacking for you? Our goal is zero learning curve but evidently we're not there yet
1. The "account-less" setup (Github link) is a little cumbersome, especially as I'm not the repo-owner, I need to keep bugging the business owner as I'm monkeying around setting up; would prefer a proper Railway account that we then link our stuff to as needed
2. The Dockerfile frustration was my own stupidity and oversight, so i can't put that on you guys.
3. The overview of your environment, where the blocks move around in the background, it's a neat idea, but a little bit gimicky, especially if you don't have access to a 2D scrolling mouse (i suppose click+drag works); would prefer a more traditional representation
4. I really would prefer a dedicated staging environment and the ability to deploy any branch we like to any environment we like; but need to give this PR deploy situation a shot before i judge prematurely
Love that, thank you! For 1, what issues are you running into that requires you to bug the business owner? For 4, you can create an environment yourself -- PR environments are just a automagic way to get environments for each PR (https://docs.railway.app/develop/environments)
1. It was just during initial setup, we’re he had to start the railway setup and verify GH account ownership (which also didn’t seem to work quite right until you fixed it for us tonight).
Yeah that one is frustrating... We're shipping a few changes to tweak all of that soon
Awesome
All just nitpicks btw, I’m just tired and grumpy and want to go back to playing FF XVI 🤣 I am excited to see how we look when we get our environment fully spun up
No worries haha, wanted to make some “nixpacks” joke with “nitpicks” but forgot 😭
this got lost in the fray, can anyone assist with this nixpack issue on our build? https://discord.com/channels/713503345364697088/1126140112590356561/1127044810415546388
you have dependency conflicts
Hmm but how would I go about resolving if I don’t have them locally? 🤔
well that's a good question
and you aren't force installing locally are you?
negative 🤔
programming is fun they said
😂
what version of node are you using locally, and what version of node is railway using (it would be printed in the build table at the top of the build logs)
I've got
20.3.1
, but interestingly, i don't actually see node getting installed in the build logs 🧐
oh! "Load More", 1 sec 😅
ok, still unsure. I see where it's installed, but no version is printed. the only reference to a version i can find is way further along, this line:
unsure if that would suggest the installed version is 16.18.1
?keep going!
all the way to the top
yea, i see the table, but there's no version
keep going!
aint can do!
ah bummer
look at another failed deployment haha maybe it won't have the table cut off
boom, ok
node 16
if you are developing locally on node 20, and then trying to run it on railway with node 16, it's probably not gonna work out lol
the only problem now is that nixpacks only supports up to node 18
rip, hmmm
so let's try with node 18 first
how do i get my nixpack to use node 18?
in your package.json set engines.node to 18
this look right? 😬
not one single bit
engines is an object at the root of the global object
ok
and then node is a text field
gulp?
yep!
aight. lemme give it a whirl
sounds good
welp, it is using 18
we sit and wait
cool
peeposit
wonder if it's cause im on ARM locally, but the Railway machine is x86
most node modules should be pretty platform independent
looks like it's failing in the same place. we're not even using trix though, wonder if we even need to declare that in the package.json 🤔
whats trix
it's Rails' integrated rich-text editor thingy
isnt this a node app
nope
ruby on rails
whats node for
it may be required to install some packages the stack depends on. im guessing that's why it's part of the nixpack?
do you have a railway.json in your project?
negative
can you show me the entire build table along with your package.json?
y
just trying to sus out any problems
sorry, meant y, as in "yes" 😆
do you have a node_modules folder in your repo
negative
(gotta run back later, thx for your help thus far)
actiontext uses trix 1.3.1, so try installing that instead of 2.0.0-alpha.1
woah baby! we've made it to the Deploy phase! 🤞
just removed trix entirely from
package.json
for now
deploy succeeded!
thanks guys for the help. sorry to have been a neusenceabsolutely where not a neusence, that's what #help is for!!
I'm glad we where able to help!
🫶