The response is in the first error message: "You are trying to install ruby-2.3.1 on heroku-18" and it should be on heroku-16.
Set stack to heroku-16 with follow instruction:
dokku buildpacks:set-property my-app stack gliderlabs/herokuish:latest-16