Many ruby projects include a .ruby-version file in the root directory, containing the version of Ruby needed.
Tools such as rvm, rbenv and chruby all recognise and use this file.
This is not unlike the .nvmrc file often used in Node projects, and the setup-node action has a discussion on potentially using the contents of that file as the node version if no with: argument is specified. (actions/setup-node#32)
I would suggest that setup-ruby might consider a similar approach, where if no explicit ruby version is given, look for a .ruby-version file and use the version contained within.