github.com tells us that:
The path to your RUBY_INSTALL_DIR must not contain any whitespaces (like in “C:\Program Files\Ruby193”). This is very important because whitespaces in the path to your ruby installation will cause certain error messages as soon as you try to install gems which require the DevKit.
This solved the problem of this kind for me.