[Idea] Customizable rubyinstaller2
Hey there,
This is mostly an idea. Please feel free to close it.
So I have been using ruby for a long long time. I have tons of scripts.
I use Linux mostly, but one laptop uses win10 + WSL1 (will change to WSL2 one day but for now I don't care enough to change).
My commandline stuff works fine on windows, but the GUIs are annoying. I remember in the past, I had ruby-gtk2 binaries, I downloaded and these worked. But now you sort of have to compile it on your own ... and that's a hassle. Windows annoys me. :P
Anyway. My idea was ... "so hey, I could get tk installed ... gtk3... and then the ruby GUIs would work". I use the ruby GUIs mostly as a wrapper over commandline functionality, so the GUI really just helps me be lazy on windows.
So this got me thinking. What if we could have a redistributable .exe or something like that? Like we can put on an USB stick?
Not only with e. g. ruby-tk, ruby-gtk and what not, but personal scripts and such. Like a rubyinstaller on steroids, aka with tons of enhancements. People could then easily customize it.
I am not sure how difficult this would be. I assume the .exe file or .msi is mostly just something zipped, so perhaps for simple text files, such as .rb files, this would be easy. But what to do about ruby-gtk and things that have to be compiled? I have too little experience with msys2 to judge; I only remember having used msys in the past and it worked quite fine. But windows annoys me still ...
Anyway - this is just mostly a question or idea. Like if we could have a customizable rubyinstaller2. This could also help maintain rubyinstaller2, people could share custom build installs and tricks and what not. Simple things like if we can install the rubyinstall2 but then also get an additional "add-on" section where we either install these add-ons, or where they come available in the customized installer.
I think Bundler is what already enables this. You can very easily write a Gemfile and an install script, and everything installs.
If you'd like to ensure native extensions are installed, you have 2 options:
- You can add a fat binary to the gem using rake_compiler, which can cross-compile the binary to Windows architectures.
- You can add an instruction to the gem's
.gemspecto install an MSYS2 package:
Gem::Specification.new do |s|
# ... other gemspec details ...
s.metadata['msys2_dependencies'] = 'package_name_1 package_name_2'
end
Both of these need to be followed up with the individual gems, not with RubyInstaller itself. So, I think this issue can be closed as "out-of-scope" for the RubyInstaller.
I've done something quite similar with JRuby actually - to create a minimal distributable, runnable-with-Java system. It was packaged using Warbler back then.