Ask A Question

Notifications

You’re not receiving notifications from this thread.

Adding GitHub Actions CI/CD to the URL Shortener Discussion

Your post has provided me with a lot of knowledge that is really helpful to me. I can't express how grateful I am. Thanks

Reply

This took me 11 tries to get working. Here are the errors I ran into along with solutions.

Error 1:
/home/runner/work/_temp/315b8fef-45fa-4e39-9779-9fa4fde9bc23.sh: line 1: bin/rails: Permission denied

Solution 1:
It's not clear from this log what script this is, but since the only thing mentioned under "run" in ci.yml is "bin/rails", I figured out that must be it.
Needed to run locally the command "git update-index --chmod=+x ./bin/rails" and push changes, issue fixed.

Error 2:
/usr/bin/env: ‘ruby.exe’: No such file or directory

Solution 2:
Probably ran into this error because I'm using Windows, but the test runs on "ubuntu-latest".
In bin/rails and bin/rake, change the "ruby.exe" to "ruby" in the shebang line, issue fixed. Seems once I did it locally I had no issues, but who knows, maybe it's better to keep it for Windows? Not sure about this one, but the Github action will fail if ruby.exe is left there.

Error 3:
Unrecognized command "bin/rails" (Rails::Command::UnrecognizedCommandError)

Solution 3:
Here in the ci.yml for run, I simply missed the "|" character on the first line. If executing multiple commands, in needs to be written as "run: |".

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.