Here are two ways that use a regular expression. (In both, nil is returned if there is no match.)
str = "category-ruby-on-rails"
str[/(?<=\Acategory-).*/]
#=> "ruby-on-rails"
str[/\Acategory-(.*)/, 1]
#=> "ruby-on-rails"
(?<=\Acategory-) is a positive lookbehind. It means that "category-" must be matched at the beginning of the string (\A), but it is not part of the match that is returned.
(.*) saves .* into capture group 1. The second argument of the instance method String#[] is the capture group whose contents are to be retrieved and returned by the method.
We could also use String#gsub:
s = str.gsub(/\Acategory-/, '')
#=> "ruby-on-rails"
but would need to check if there had been a match. For example,
s == str
#=> false (meaning the match was performed)
There are many other ways to do this, including some that don't use a regular expression.
s = "category-"
str[s.size..-1] if str.start_with?(s)
#=> "ruby-on-rails"
str = "division-ruby-on-rails"
str[s.size..-1] if str.start_with?(s)
#=> nil
some-words-separated-by-hyphen? no matter if this starts withcategory-?