According to the steps below, giving msvcrt-ruby270.dll path to &rtp and &path,
I don't understand why Gvim tries again to find msvcrt-ruby270.dll in $VIMRUNTIME path and fails.
Trying to get ruby 2.7 dynamically :ruby p 'hell' returns
E370: Could not load library D:ogiciels/Vim/vim82/
Nota: downloaded dll is win32.
Step 1/ According to the help
MS-Windows ~ You need to install the right version of Ruby for this to work. You can find the package to download from: http://rubyinstaller.org/downloads/ Currently that is rubyinstaller-2.2.5.exe To use the Ruby interface the Ruby DLL must be in your search path. In a console window type "path" to see what directories are used. The 'rubydll' option can be also used to specify the Ruby DLL. The name of the DLL must match the Ruby version Vim was compiled with. Currently the name is "msvcrt-ruby220.dll". That is for Ruby 2.2.X. To know for sure edit "gvim.exe" and search for "ruby\d*.dll\c". <=OK -DDYNAMIC_RUBY_DLL="msvcrt-ruby270.dll" If you want to build Vim with RubyInstaller 1.9 or 2.X using MSVC, you need some tricks. See the src/INSTALLpc.txt for detail. If Vim is built with RubyInstaller 2.4 or later, you may also need to add "C:\Ruby<version>\bin\ruby_builtin_dlls" to the PATH environment variable.
Step 2/ According to that lines in _vimrc:
" Ruby 2.7
Step 3/ According to the return of let dlls=globpath(&rtp, "*.dll")