0

I hope you are all well!

For several days now I have been trying to deploy a simple rails app to Railway.app, and failing catastrophically and repeatedly to get it to run.

Here is the github repo:

https://github.com/CaffieneSage/blogApp-rails-

The error I am getting is during the deploy step specifically:

bundler: not executable: bin/rails

I have successfully deployed apps to heroku in the past. I suspect there is something simple that I am missing. I have tried rerolling and deploying the default rails app to simplify things. I have made sure to us postgres instead of SQLite3 as the db. I have spun up an instance of postgres on railway and tried to set my environment variables to point to it. I have had a go within the CLI as well.

Thanks in advance for any advice you may have to offer!

This is my first post on stack overflow, please go easy on me ;]

  • Please post code, not links to repos. In this case, post the steps you take to try to deploy on Railway and the result of each step. – Chiperific Jan 14 '23 at 14:06
  • Thanks for the reply, I will bare that in mind for the future as regar git repos. I cant post any specific code as I am not sure if it is a code issue per se, or more of my lack of understanding of the environment. The app appears to build fine, but immediately crashes on deploy with the above error. I have a suspicion it is trying to run bundle install and encountering a problem, but that is pure guesswork on my part. – CaffieneSage Jan 14 '23 at 14:31
  • But, you can list your steps (e.g., I connect Railway to my Github account) and you can add in the Railway build logs as code. – Chiperific Jan 14 '23 at 15:30
  • Thanks bud, Mike F's steps in another comment helped to get this sorted. Its deployed and exposed to the web, and is showing good old rails flavoured errors now. Thanks for your input regardless, i really do appreciate it! – CaffieneSage Jan 14 '23 at 16:15

1 Answers1

2

The issue likely stems from the script bin/rails not having the executable bit on the file.

You can see the file permissions using ls:

ls -l bin/

All of the files will display:

-rw-r—r—

These need to have the executable bit set, so you can run something like:

chmod +x bin/*

After which all the files should have this permission set:

-rwxr-xr-x

Don’t forget to commit the changes.

Read more on file permissions: https://en.wikipedia.org/wiki/File-system_permissions

Mike Fiedler
  • 691
  • 1
  • 11
  • 26
  • Much obliged, I will have a play with this ;] – CaffieneSage Jan 14 '23 at 14:34
  • 1
    Right its seems to have deployed successfully. I had to do the above, and change git's config file to make it track those changes.I then had to change the "mode" from 100644 to 100755. I think the fact that I am developing on windows like a peasant has complicated matters somewhat. Thanks again for taking the time out of your saturday guys! – CaffieneSage Jan 14 '23 at 15:44
  • Great to hear! Feel free to mark the answer as Accepted. – Mike Fiedler Jan 14 '23 at 18:44