Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you use a non-RubyInstaller version of Ruby (IE from the likes of MSYS2), the "RubyInstaller" class is not available.
This prevents Ruby2D from running your scripts, citing a missing
ruby2d.so
file.The reason this was happening is because of the following line:
RubyInstaller::Runtime.add_dll_directory(File.expand_path(s2d_dll_path))
The above line adds the
assets/mingw/bin
folder to an include list (so Ruby2D can use the DLL's it contains), but is dependent onRubyInstaller
. The fix is to get rid of this dependency, which can be done using thefiddle
gem. It seems thatfiddle
is a default Ruby gem, so everybody should have it installed.The above code works for me. It's not been tested on other versions of Ruby.