Unable to run railway run
In railway-cli version railwayapp 3.3.1 in a linked project and service, when I try to run a railway run command it just run locally. My project is a Docker project with a different docker file that the default one. It does not matter if a run within a subshell (railway shell) or not.
I already tried docker commands, unix commands and web server commands (rails) and nothing works.
Am I doing something wrong?
34 Replies
Project ID:
56a79696-4ad8-425e-8418-c891a338c23c
56a79696-4ad8-425e-8418-c891a338c23c
no you're not doing anything wrong
railway run
only runs commands locally, it first pulls the environment variables from your railway service and then runs the given command locally with the service variables now available
same with railway shell
it is a local shell, just with the variables from the railway service addedThank you Brody !.
It is possible to run the command inside the Docker container??.
it is not, but tell me the command you want to run and maybe I can come up with a solution for you
Sure!, I'm running a dockerized rails application. I'm looking to have a rails console, so the command for that usually is.
im not a ruby/rails dev so could you help me to understand what a rails console does/achieves?
sure, rails console lets you interact with a rails application within the terminal
interact how
like what is the ultimate end goal here
Is a REPL
dont know what that is
ok, so I'll give you an example
This is an example of a repl in node.js
https://www.digitalocean.com/community/tutorials/how-to-use-the-node-js-repl
How To Use the Node.js REPL | DigitalOcean
The Node.js Read-Eval-Print-Loop (REPL) is an interactive shell that processes Node.js expressions. The shell reads JavaScript code the user enters, evaluate…
is kind of similar in ruby
but with the entire application loaded
so you can execute ORM / database commands, explore the application and do troubleshooting
basically you are interacting with your application with console
got it, but specifically what do you want to execute
e.g. I want to re-send an email to a user that didn't receive the email.
with rails console I can do something like.
yep, so you will need to do something like rails console
but we don't let you SSH in yet
(soon, as a former Rails dev, I understand the need to)
Hi Angelo, thank you. That would be awesome.
for now i think you would need to implement something like that in an api endpoint
that or under /admin routes
Is there a way of execute rake tasks?
or bash scripts?
rake on init
but no, you should think as deploys as final cuts of your code
I understand, that's the way.
I'm exploring what kind of things I can do
developers can make mistakes, and I would like to understand if there is a way to troubleshoot cases with exceptions.
I get it but jumping into the running state of the app atm isn't how we currently support the debugging loop
anyway hope this helps and you can upvote a similiar feature request over at https://feedback.railway.app
Railway Feedback
Give feedback to the Railway team so we can make more informed product decisions. Powered by Canny.
sure, you guys are doing an amazing job, would be good if you can release that soon
I'll vote for sure
so basically railway run is not working in a Dockerized application atm.
as stated above,
railway run
is for running commands locally onlydo you have documentation with some examples?
just to understand better the use cases
from
railway --help
the docs talk about it a bit more
https://docs.railway.app/develop/cli#local-developmentI'll run node and rails applications, dockerized and non dockerized, so would be good to have a better understanding of that.
thats about all the information i have on the matter
ok, I think I can run rails console pointing into the production database with that. I don't need to jump into the docker container. So that can help.
I'll let you know If I have succeed with that.
yeah that should be do-able for database related actions
Ok, I was able to run rails console with railway executing the following command
Hope this can help someone else.