After upgrading my laptop from Fedora 43 to Fedora 44, rubyripper would crash when Musicbrainz was selected (in preferences) as the metadata provider. Running from the command line gave the following:
`
$ rrip_gui
#<Thread:0x00007f902827a140 /usr/lib/rubyripper/gtk3/gtkDisc.rb:79 run> terminated with exception (report_on_exception is true):
/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.rb:68:in 'GetMusicBrainzRelease#queryMusicBrainzForMatches': undefined method 'parse' for class CGI (NoMethodError)
query = CGI.parse(uri.query)
^^^^^^
`
No such error on my workstation that was still running Fedora 43.
This Stack Overflow post was helpful in terms of finding where rubyripper was looking for the cgi gem: "https://stackoverflow.com/questions/5226707/how-to-find-the-path-a-ruby-gem-is-installed-at-i-e-gem-lib-path-c-f-gem-bin"
I added the following temporary code to the file "/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.rb" just before the call to CGI.parse():
`
# Temporary debug code
puts "About to call CGI.parse()"
# gem_root = Gem.loaded_specs['cgi'].full_gem_path
spec = Gem::Specification.find_by_name("cgi")
gem_root = spec.gem_dir
puts gem_root
`
This resulted in additional text output running rrip_gui from the command line:
$ rrip_gui -v About to call CGI.parse() /usr/local/share/gems/gems/cgi-0.5.2 #<Thread:xxxxx etc.
I can speculate but not confirm (the directory layout on my workstation is completely different) that at some point the file layout of the rubygem cgi changed. I am sure there was an announcement in the correct place but I have not seen it. On my laptop, at path "/usr/local/share/gems/gems/cgi-0.5.2/lib/cgi/", it is thus:
`
session
cookie.rb
core.rb
escape.rb
html.rb
session.rb
util.rb
`
If line 24 in the file "/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.r" is changed to:
require 'cgi/core'
rubyripper does not crash and the metadata is fetched from Musicbrainz.
As to what permanent changes, if any, might need to be made to the code, perhaps an if-then-else test for the version of the cgi gem? the change that solves my immediate problem might break someone else's setup. I am looking forward to any comments and feedback.
Thanks!
After upgrading my laptop from Fedora 43 to Fedora 44, rubyripper would crash when Musicbrainz was selected (in preferences) as the metadata provider. Running from the command line gave the following:
`
$ rrip_gui
#<Thread:0x00007f902827a140 /usr/lib/rubyripper/gtk3/gtkDisc.rb:79 run> terminated with exception (report_on_exception is true):
/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.rb:68:in 'GetMusicBrainzRelease#queryMusicBrainzForMatches': undefined method 'parse' for class CGI (NoMethodError)
`
No such error on my workstation that was still running Fedora 43.
This Stack Overflow post was helpful in terms of finding where rubyripper was looking for the cgi gem: "https://stackoverflow.com/questions/5226707/how-to-find-the-path-a-ruby-gem-is-installed-at-i-e-gem-lib-path-c-f-gem-bin"
I added the following temporary code to the file "/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.rb" just before the call to CGI.parse():
`
# Temporary debug code
puts "About to call CGI.parse()"
# gem_root = Gem.loaded_specs['cgi'].full_gem_path
spec = Gem::Specification.find_by_name("cgi")
gem_root = spec.gem_dir
puts gem_root
`
This resulted in additional text output running rrip_gui from the command line:
$ rrip_gui -v About to call CGI.parse() /usr/local/share/gems/gems/cgi-0.5.2 #<Thread:xxxxx etc.I can speculate but not confirm (the directory layout on my workstation is completely different) that at some point the file layout of the rubygem cgi changed. I am sure there was an announcement in the correct place but I have not seen it. On my laptop, at path "/usr/local/share/gems/gems/cgi-0.5.2/lib/cgi/", it is thus:
`
session
cookie.rb
core.rb
escape.rb
html.rb
session.rb
util.rb
`
If line 24 in the file "/usr/lib/rubyripper/metadata/musicbrainz/getMusicBrainzRelease.r" is changed to:
require 'cgi/core'rubyripper does not crash and the metadata is fetched from Musicbrainz.
As to what permanent changes, if any, might need to be made to the code, perhaps an if-then-else test for the version of the cgi gem? the change that solves my immediate problem might break someone else's setup. I am looking forward to any comments and feedback.
Thanks!