Roman numeral converter in Ruby
Some notes:


Use 2 spaces for indentation, not 4.
key, numeral = digit: You can unpack block arguments: do |acc, (key, numeral)|.
Concating strings is costly, better build an array and finally join it.
You are using inject, which is great because it'a functional abstraction, but you are modifying num on each iteration, so it ends up being a weird mixture of functional and imperative style. I know it's a bit cumbersome, but conceptually it's better to keep also num in the accumulator.


I'd write:

digits.reduce(:output =&gt; [], :num =&gt; num) do |state, (key, numeral)|
  ocurrences, remainder = state[:num].divmod(key)
  {:output =&gt; state[:output] &lt;&lt; (numeral * ocurrences), :num =&gt; remainder} 
end[:output].join