Cyclic dependency
sj26 opened this issue · comments
Samuel Cochran commented
I was trying to install the HEAD of gel via homebrew by adding a head "https://github.com/gel-rb/gel.git"
to the hombrew formula, but it fails while generating man pages with:
ronn --roff --manual 'Gel Manual' man/man1/gel-exec.1.ronn man/man1/gel-install.1.ronn man/man1/gel.1.ronn
/private/tmp/gel-20190807-63682-1ivzf57/lib/gel/catalog/marshal_hacks.rb:3:in `<top (required)>': uninitialized constant Gem (NameError)
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/catalog/dependency_index.rb:10:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/catalog/dependency_index.rb:10:in `<top (required)>'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/catalog.rb:152:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/catalog.rb:152:in `<top (required)>'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:10:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:10:in `initialize'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:84:in `new'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:84:in `block (2 levels) in load'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:59:in `each'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:59:in `block in load'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:55:in `each'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/resolved_gem_set.rb:55:in `load'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/lock_loader.rb:9:in `initialize'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/environment.rb:365:in `new'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/environment.rb:365:in `activate'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/runtime.rb:26:in `<top (required)>'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/compatibility/rubygems.rb:9:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/compatibility/rubygems.rb:9:in `<top (required)>'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/compatibility.rb:4:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/compatibility.rb:4:in `<top (required)>'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/command.rb:3:in `require_relative'
from /private/tmp/gel-20190807-63682-1ivzf57/lib/gel/command.rb:3:in `<top (required)>'
from bin/gel:12:in `require_relative'
from bin/gel:12:in `<main>'
rake aborted!
Command failed with status (1): [ronn --roff --manual 'Gel Manual' man/man1...]
/private/tmp/gel-20190807-63682-1ivzf57/Rakefile:44:in `block in <top (required)>'
-e:1:in `<main>'
Tasks: TOP => man
(See full trace by running task with --trace)
lib/gel/catalog/marshal_hacks.rb
seems to presume the the Gem
module exists, but this is being required in the same stack that is trying to load the lib/gel/compatibility/rubygems.rb
file which defines the module. Any ideas?
Samuel Cochran commented
Moving the contents of lib/gel/catalog/marshal_hacks.rb
into lib/gel/compatibility/rubygems.rb
seems to make this work fine.