<div dir="ltr">I am most definitely a Ruby expert, but I have yet to run any version of Ruby from MacPorts (because I use `ruby-build` and `mise` to build versions of Ruby that I require), and I almost exclusively install Ruby packages via `gem install`.<div><br></div><div>I have *not* looked at the Ruby pg or many of the Ruby ports themselves, but Ruby has a very high level of backwards compatibility, at least for pure Ruby gems (no C extensions):</div><div><br></div><div>- Code written for Ruby 1.6 or higher *may* run unmodified on later versions, including Ruby 3.3. If there is string manipulation at the character level, from Ruby 1.9 the string representation changed from just a bag of bytes to a bag of bytes with an encoding attached so that direct character access does not give the byte at that position.</div><div>- Code written for Ruby 1.9 or higher will *most likely* run unmodified on later versions, including Ruby 3.3, excepting about 4–5 methods that were deprecated in Ruby 2.0–2.4 and finally removed in Ruby 3.3.</div><div><br></div><div>Many gemspecs contain information about the minimum Ruby that they require to run (mime-types 3 requires Ruby 2+, <a href="https://github.com/mime-types/ruby-mime-types/blob/main/mime-types.gemspec#L20">https://github.com/mime-types/ruby-mime-types/blob/main/mime-types.gemspec#L20</a>; diff-lcs advertises compatibility with Ruby 1.8+; app_identity advertises Ruby 2.7+, but not Ruby 4, <a href="https://github.com/KineticCafe/app_identity/blob/8afdd1caaab8d18032f60416eb62add88d308ee0/ruby/app_identity.gemspec#L21">https://github.com/KineticCafe/app_identity/blob/8afdd1caaab8d18032f60416eb62add88d308ee0/ruby/app_identity.gemspec#L21</a>).</div><div><br></div><div>I don't know whether the Ruby and various gem ports are set up to work like the Python and package ports (e.g., py311, py311-requests), but as each gem must be installed into each Ruby, that's the best approach to use (e.g., for *every* Ruby port, there should be Ruby version ports; rb-diff-lcs and rb19-diff-lcs should have versions for rb18, rb19, rb20, rb21, rb22, rb23, rb24, rb25, rb26, rb27, rb30, rb31, rb32, and rb33).</div><div><br></div><div>I also think that the `ruby` port needs to be renamed to `ruby18` and `port install ruby` should *either* fail (like `port install python` or `port install python3` does) or it should install the latest stable version (updated on Christmas Day every year).</div><div><br></div><div>*Or* there should be an option with Ruby ports to treat them like non-offline Go ports and allow them to do `gem install` or `bundle install` for more complex environments.</div><div><br></div><div>Unfortunately, my tcl isn't really good enough (aside from what bits of Tcl I’ve done now that I am contributing to MacPorts port maintenance, I last used Tcl in about 2004) to start working with rethinking the Ruby portgroup to have something like `ruby.bundle` or `ruby.gems` that works like `cargo.crates` or `go.vendors`, which would *probably* be the better choice (and it would pull from `<a href="http://rubygems.org">rubygems.org</a>` *not* <a href="http://github.com">github.com</a>; gems are source distributions most of the time, although some gems exist that contain precompiled binaries for hard-to-build dependencies).</div><div><br></div><div>-a</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 16, 2024 at 10:52 AM Sergio Had <<a href="mailto:vital.had@gmail.com">vital.had@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div>
<div name="messageBodySection">
<div dir="auto">Any Ruby experts among us?<br>
<br>
Some Ruby ports hardcode versions for dependencies in a form restricting those to a given major or minor version. Since many Ruby gems are not updated for years (but still required for other stuff), this presents a problem: any dependency using those will build but not run.<br>
Is there a way to solve this other than by patching every such instance? Patching works but is pretty tedious.<br>
Ideally a solution via Ruby PG is preferred, I think.</div>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Austin Ziegler • <a href="mailto:halostatue@gmail.com" target="_blank">halostatue@gmail.com</a> • <a href="mailto:austin@halostatue.ca" target="_blank">austin@halostatue.ca</a><br><a href="http://www.halostatue.ca/" target="_blank">http://www.halostatue.ca/</a> • <a href="http://twitter.com/halostatue" target="_blank">http://twitter.com/halostatue</a></div>