For anyone that have the same question and haven't yet resolved it.
packages:
yum:
ruby22: []
ruby22-devel: []
container_commands:
01-set_ruby22:
command: "alternatives --set ruby /usr/bin/ruby2.2"
02-install_sass:
command: "gem install sass"
First, via yum we install the latest supported version of Ruby and Ruby Devel (I prefer 2.4, but the question is for 2.2), after, via container_commands, we set the current ruby version to the latest one, and later we install sass
I prefix the mumbers because it tells to container commands the order in which I need to run each command.