Revert "ruby: Fix build on systems with store optimisation. Closes #4273. #4266 promises a better fix."

This reverts commit d2c0011c2fafa92624b30a2408123a15a1af390f.

c04e49289871232ff3c2fd1239b64c2513f18fd1 gives a cleaner solution that's
not specific to ruby.