When you install ruby using rbenv on ubuntu, sometimes build doesn’t work. Then you should make custom build system for ruby. Make new build system rbenv.sublime-build, use the following JSON codes:

{
  "cmd": ["/home/[user]/.rbenv/shims/ruby", "$file"],
  "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
  "selector": "source.ruby"
}