-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error loading gem from metamora-cli #83
Comments
As i've said in my email, I may not be able to pin this down in the general case. But there's a straightforward way to get this working, at least for me: Edit the Gemfile of the root of the mn-samples-ribose directory, to add:
And then run Let me know if that works. Ribose is not included in the gemspec of metanorma-cli, and that is deliberate: we aren't able to add all possible flavours in our official release, because some may be created by third parties. |
Thanks, using the bundle exec on the cloned git repo did indeed work, but metanorma-cli as an installed gem does not work with the type ribose, even with the metanorma-ribose gem installed as in my initial comment. |
@abunashir, could you please investigate? My dev environment is too dirty for me to, and this is beyond my expertise. |
Indeed @bougyman this has been an issue. The expectation is for metanorma-cli to automatically load the proper version of metanorma-whatever (if installed) if it has been requested in the @abunashir can you help with this? As you remember, my previous approach with searching through gems gives very poor performance due to the way Ruby loops through gems/versions... This task is related to metanorma/metanorma-cli#81 |
Sure, I will look into it and get back to you guys soon 👍 |
TLDR; Hey there, my apologies for the long delay. I had a look into this today and looks like there seems to be some issue with the gem dependencies between
Based on metanorma dependencies I think it would be super hard to ensure number 1 at any given time, so I would suggest to go with number 2 and let bundler resolve the dependencies for us. Long Version The issue seems to be caused by multiple versions of So when we are running the compile steps then metanorma tries to load the /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:2247:in `raise_if_conflicts': Unable to activate metanorma-ribose-1.6.10, because metanorma-generic-1.8.0 conflicts with metanorma-generic (~> 1.8.1) (Gem::ConflictError)
19: from /root/.asdf/installs/ruby/2.7.2/bin/metanorma:23:in `<main>'
18: from /root/.asdf/installs/ruby/2.7.2/bin/metanorma:23:in `load'
17: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/exe/metanorma:20:in `<top (required)>'
16: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/lib/metanorma/cli.rb:65:in `start'
15: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
14: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
13: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
12: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
11: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/lib/metanorma/cli/command.rb:42:in `compile'
10: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/lib/metanorma/cli/compiler.rb:35:in `compile'
9: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/lib/metanorma/cli/compiler.rb:30:in `compile'
8: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-cli-1.4.0/lib/metanorma/cli/compiler.rb:45:in `compile_file'
7: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-1.2.2/lib/metanorma/compile.rb:18:in `compile'
6: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/metanorma-1.2.2/lib/metanorma/compile.rb:71:in `validate_type'
5: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
4: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:161:in `rescue in require'
3: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems.rb:210:in `try_activate'
2: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems.rb:217:in `rescue in try_activate'
1: from /root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:1369:in `activate'
/root/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:2247:in `raise_if_conflicts': Unable to activate metanorma-ribose-1.6.10, because metanorma-generic-1.8.0 conflicts with metanorma-generic (~> 1.8.1) (Gem::ConflictError) Fix: I would follow Nick's suggestion here to use a local |
@abunashir this suggestion does not actually help the problem except for developers:
Because users of Metanorma are not expected to be familiar with Ruby, and of course they cannot be expected to be familiar with Bundler. The real issue is this one: metanorma/metanorma-cli#81 |
There has been a long pending issue with the performance for the cli, especially if we have multiple version installed. In that case lots of gem still stays as unresolved, and that could cause some of the performance issue. This commit follows some suggestion to explicitly activate those gems, as it should resolve the dependencies early. This should also fix the private gem loading issue as we have seen on another repo Related: metanorma/metanorma-ribose#83
There has been a long pending issue with the performance for the cli, especially if we have multiple version installed. In that case lots of gem still stays as unresolved, and that could cause some of the performance issue. This commit follows some suggestion to explicitly activate those gems, as it should resolve the dependencies early. This should also fix the private gem loading issue as we have seen on another repo Related: metanorma/metanorma-ribose#83
When I attempt the sample workflow, I receive the following message:
Metanorma version(s):
And metanorma-ribose verion:
I've attempted to breakpoint metanorma-cli to see where the problem is, but have not succeeded yet. I can load the metanorma-ribose gem fine with
ruby -r metanorma-ribose
/pry -r metanorma-ribose
.The text was updated successfully, but these errors were encountered: