rvm has a nice command to create .ruby-version and .ruby-gemset files:

rvm --create --ruby-version use ruby@2.4