Ruby command to edit a field in a SAM file
There isn't much to say here, it is clear what your solution is doing, and attempts to make it more concise would just make it harder to read.

I recommend replacing map! with each - map! indicates that you want the values returned by grep to be changed in place. Since that result is then discarded, it makes the code more difficult to understand.

Personally, I avoid ! methods whenever possible. The hidden mutation which can occur makes code harder to reason about. It is fine in this small example (especially once map! is replaced with each), but in a larger program it will hide bugs.

Avoiding mutation in this case makes the code a bit longer, but it has the benefit of not needing to stop and think about what has changed and if it matters. I spent several minutes trying to figure out why your code didn't fail when a field didn't include a - since gsub! returns nil when no replacements are made.

Though less concise, I prefer the following version:

ruby -ane '
$F[11..] = $F[11..].map { |x| x.start_with?("RX:Z:") ? x.gsub(/-/, "") : x }
puts $F.join "\t"
' file.sam


Not automatically joining $F back together to create $_ makes sense, what should ruby do if you use (or modify) $F but then set $_ to something else? Setting $_ whenever $F is modified would be rather confusing and bad for performance.