Ruby security updates

These commits fix the security issue described in [CVE-2013-4164](https://www.ruby-lang.org/en/news/2013/11/22/heap-overflow-in-floating-point-parsing-cve-2013-4164/). Ruby 1.8.7 has also been updates but it still vulnerable to that CVE. Ruby 1.8.7 is not supported by the ruby core team and should probably be removed from the repo entirely.

The Darwin patch has also been imported from #1229