BallAerospace / COSMOS

Ball Aerospace COSMOS
https://ballaerospace.github.io/cosmos-website/
Other
361 stars 129 forks source link

Error with `nokogiri` 1.13.6 #1623

Open bradley-harden-apl opened 2 years ago

bradley-harden-apl commented 2 years ago

Describe the bug After installing the cosmos gem locally and trying to run it, I'm getting an error in one of the dependencies.

Traceback (most recent call last):                                                                                                                
        17: from COSMOS/cosmos/bin/cosmos:26:in `<main>'                                                                                          
        16: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
        15: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
        14: from /home/.../COSMOS/cosmos/lib/cosmos/models/plugin_model.rb:27:in `<top (required)>'         
        13: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
        12: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
        11: from /home/hardebj1/projects/lunar_vertex/lvx-cosmos/COSMOS/cosmos/lib/cosmos/models/gem_model.rb:21:in `<top (required)>'            
        10: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                          
         9: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'                                                          
         8: from /usr/lib/ruby/vendor_ruby/nokogiri.rb:36:in `<top (required)>'                                                                   
         7: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
         6: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'                                                          
         5: from /var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml.rb:53:in `<top (required)>'                               
         4: from /var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml.rb:53:in `require_relative'                               
         3: from /var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml/node.rb:6:in `<top (required)>'                           
         2: from /var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml/node.rb:7:in `<module:Nokogiri>'                          
         1: from /var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml/node.rb:56:in `<module:XML>'                              
/var/lib/gems/2.7.0/gems/nokogiri-1.13.6-x86_64-linux/lib/nokogiri/xml/node.rb:59:in `<class:Node>': uninitialized constant Nokogiri::ClassResolve
r (NameError)

To Reproduce

git clone https://github.com/BallAerospace/COSMOS.git
export RUBYGEMS_URL="https://rubygems.org"                                                                                                  
cd COSMOS/cosmos                                                                                                                            
bundle install                                                                                                                              
rake build
cd ../../
export RUBYLIB="$PWD/COSMOS/cosmos/lib"                                                                                                     
ruby COSMOS/cosmos/bin/cosmos help

I can solve the problem by first uninstalling nokogiri, changing the gemspec dependency from ~> 1.12 to = 1.12, and then rebuilding cosmos.

Environment:

ghost commented 2 years ago

I think the problem is this: https://stackoverflow.com/questions/70877760/on-ruby-uninitialized-constant-nokogiriclassresolver-nameerror

Try: sudo apt-get remove ruby-nokogiri

bradley-harden-apl commented 2 years ago

@ryanatball

Package 'ruby-nokogiri' is not installed, so not removed

Does it work for you with 1.13.6? Is this a lock file issue or something? Like I said, I was able to manually remove nokogiri with gem uninstall, modify the spec and reinstall with 1.12. Then it worked just fine.