8000 Update ruby2d.rb by richpeck · Pull Request #228 · ruby2d/ruby2d · GitHub
[go: up one dir, main page]

Skip to content

Update ruby2d.rb #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Update ruby2d.rb #228

wants to merge 3 commits into from

Conversation

richpeck
Copy link

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 on RubyInstaller. The fix is to get rid of this dependency, which can be done using the fiddle gem. It seems that fiddle 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.

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 on `RubyInstaller`. The fix is to get rid of this dependency, which can be done using the `fiddle` gem. It seems that `fiddle` 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.
Windows supports 'where' natively
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0