How 'bout we just...
...don't ever write things in #Ruby.
I mean, whenever I try to install something written in Ruby, I run into problems I don't get with any other language.
The problem doesn't seem to be so much with the language itself as with the packaging system(s) that apparently everyone uses -- but the error messages are really unhelpful and leave me with no idea where to start.
The problem this time is some kind of undeclared function -- but searching the web for the function (so I could figure out what I need to install) just leads to other people trying to solve the same problem and never really getting to an understanding of what was causing it.
It also kind of feels like the people who do understand these things are almost proud of how tricky such problems are to fix and/or how little understanding they have of what the basic concepts are that one needs to understand in order to properly deal with such problems in the future.
I got past one error by editing one of the system libraries, which is probably a Bad Solution, but... geez, guys, ever hear of graceful fallback?
/usr/lib/ruby/2.7.0/mkmf.rb, for the record.
On to gewgling the next syntax error...
I seem to have gotten it to install by making the same change in about 4 places in 2 different files.
So now, whenever something automatically upgrades those libraries, everything will break again... and I'm not quite sure what installed them...
Can I submit a pull request? (Redmine uses subversion, but what does Ruby use?)
Also, the install documentation is out of date:
$ bundle install --without development test rmagick
--without flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use
bundle config set --local without 'development test rmagick', and stop using this flag
(...followed by the usual reminder not to run bundler as root even though it will probably need root privs at some point.)
@woozle Something even more subversive?
@woozle Sometimes I wonder if prior to ever release, we should take away the developers' machines and make them start over with fresh ones.
Just how many previously-unnoticed environmental assumptions would come to light?
@SetecAstronomy I vote for you as President of Software.
@woozle https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute looks like they prefer you to open a redmine ticket, which will forward it to the mailing list.
@FiXato It looks like submitting a pull-request would be appropriate for these very small fixes -- but I feel like I should actually get my instance working first, just to establish that they're not breaking something further down in the process.
So far so good with the testing process...
@woozle where did you change this btw? in the find_executable0 method, or the find_library one?
A safer way might be to override the method in the installer, and either fail early or ensure the path is a valid value.
I ended up editing two different files:
[insert and then delete a lot of rambling about trying to figure out where I made the changes]
Kate edit-history to the rescue!
The monkey-patching advice seems good, but I have no idea how to do it just from his instructions.
As far as submitting patches:
I found mkmf.rb, but still no idea where rbconfig.rb is.
If I could find both of them, I could clone the repo, make the change in my clone, and do a diff to get which lines were changed (and possibly do a PR for the changes).
@woozle with the paths.collect one I am guessing that one of the paths is nil somehow, in which case it might also be worth removing it from the array with
paths.compact.collect, though I'm curious what would cause the path to be nil.
As far as
rbconfig.rb goes, I believe that's created by mkconfig.rb:
# This script, which is run when ruby is built, generates rbconfig.rb by
4 # parsing information from config.status. rbconfig.rb contains build
5 # information for ruby (compiler flags, paths, etc.) and is used e.g. by
6 # mkmf to build compatible native extensions.
@FiXato So where would one patch mkconfig.rb so that the code it generates has that patch in it?
As yet, I have zero experience coding in Ruby, so this looks way above my spoons-level.
@woozle I would guess https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_2_6/tool/mkconfig.rb?view=markup#l146, though I also see https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_2_6/tool/mkconfig.rb?view=markup#l295
Though I have to admit that this is a bit beyond my comfort zone too :) I have no experience with native extensions in Ruby apart from making use of them. ;)
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!