Ruby Packaging on Windows - gosu/gosu GitHub Wiki
To compile your Ruby game into an executable on Windows11, you can use Ocran.
gem install ocran
ocran my_game_file.rb --windows --icon C:\Users\$USER\<dir>\game\assets\images\logo.ico --output GameName.exe --verbose
Alternatively you can use Ocra which is not very stable for Win11
gem install ocra
ocra my_ruby_game.rb --windows --dll ruby_builtin_dlls\libssp-0.dll --dll ruby_builtin_dlls\libgmp-10.dll --dll ruby_builtin_dlls\libgcc_s_seh-1.dll --dll ruby_builtin_dlls\libwinpthread-1.dll
(In theory Ocra should pick up all required DLLs automatically, but in practice the created EXE file will fail with a misleading error message if you do not manually bundle the DLLs above.)
Ocra also supports other interesting options such as --chdir-first
and --icon
.