Closed randohinn closed 4 months ago
Does the app run otherwise?
It’s hard to tell if the “command not found” is coming from the host trying by to execute docker, or the container trying to execute bin/rails, but consider that it could be either. Ensure the first host defined is your rails app, and not an accessory or other image.
Finally, I recall having issues in my windows days when a file would have Windows line endings (\r\n) being executed on a Linux host, similar to what you’ve described. You might try checking your files to make sure they are consistently ending with Linux endings, particularly the .ENV file.
Actually, the more I think about how easy it would be to do this in your setup, and what effects line endings of \r\n would have in Linux, I think that’s the first thing you should do. Open your .env file in an editor that makes it easy to convert to Linux line endings, and then kamal env push
.
Good luck friend!
The app works flawlessly otherwise. And if i run docker run -it --rm --env-file .kamal/env/roles/IMAGENAME.env COMPANYNAME/IMAGENAME:latest bin/rails c directly on the host, it works too
@randohinn - if you try to run kamal app exec -i bin/rails
does it give you a No such file or directory
error, or does it run ok (giving a usage summary).
Or what happens if you re-use an existing container - kamal app exec -i --reuse "bin/rails c"
?
This might be a kamal on windows powershell specific thing... Here is the output when trying to launch a console
And the dockerfile of this app
How do I get a working rails console?