If you need simple thing like deploying Rails (i.e going to production) follow this: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-16-04
Once you have mastered it, you can move to something called capistrano that will make you to do this stuff quicker.
If you want to test your project well, read the book Rails Test Prescriptions.
Once you are done with the above stuff, start googling for Continuous Integration. That will automate more thus freeing you up a lot.
It will take time and patience to learn Rails and Devops, so be calm.