Ruby 2.1.1 (continuation of #535)

Reboot of pull request #535, only updated to the current state of development for easier merging