I thought it could be wrong or out of date Docker image that you spectify at the image attribute.
You can find a list of all supported Ruby versions and corresponding image tags at https://hub.docker.com/r/library/ruby/. And try to build with a valid version for your project again.
Where is your public key that you got? Make sure you used a right SSH pub key.
Bitbucket Pipeline have SSH Key itself. Inside, project’s setting panel then see at Pipeline section.
Have you see your staging server in the known hosts?