ruby: Fix build on systems with store optimisation

(The build process attempted to copy file a overwriting file b, where a
and b are hard-linked, which results in cp returning a non-zero exit
code.)
https://github.com/NixOS/nixpkgs/issues/4266
Merge branch 'fix_ruby' into myhead