I recieved this error on my IFC Manager Extension:
It has to do with the rubyzip gem I included since version 4 (to be able to extract the XSD schema from the SKC’s and export ifcZIP files).
I could directly include the rubyzip code in my own namespace, but using a gem seemed like the official way to do this. Like @DanRathbun mentioned here
The include happens here
I found out that older Sketchup versions need a specific version of rubyzip to work.
That is not correct - SketchUp do not support the gem system. We strongly recommend against using it in production extensions. Embedding it into your own extension namespace is the way to go.
There seem to be more and more questions about usage of gems. I’m almost tempted to introduce a warning to SU’s version of Gem.install to make it clear that it’s not a supported or recommended feature.
Side note, if you use rubocop-sketchup to analyse your extension code you get a lot of recommendations and suggestions. It also cover a number of cases where we might reject an extension to the Extension Warehouse. Gem.install is one of these: Requirements Cops - RuboCop SketchUp: SketchUp Extension Best Practices
And thanks again! I will take another serious look into that
@tt_su A related side question. I never applied for inclusion of this addon in the extension warehouse because it is a partial duplicate of core functionality.
I hope it’s an improvement over te native IFC export (that’s the idea behind it anyway ). Do you think it worth the effort of applying for inclusion, or would it be rejected right away?
I see many complaints in the Ruby Console about redefined constants because the Rubyzip Gem code is embedded within more than one extension - each of its constants triggers a warning when the code is loaded again by each extension. Unless modules are renamed in each such use, such (harmless but annoying) collisions seem inevitable.
For the record, that was an old post. Use of RubyGems (especially binary gems) has gotten progressively more complicated and problematic over the years.
So what used to work easily, does not anymore as Thomas explained in his linked post:
Around SU v2018 RubyGems core changed and it’s web repository stopped working with older versions that SketchUp still had.
Re RubyZip, I believe is all pure Ruby. No binaries.
It has what it lists as minimum required Ruby version, but I think this may just be the “supported” minimum version. Ie, the author does not support installing the gem into old Ruby version that are at end of life.
So, just to follow up on the RubyZip challenge, your extension can wrap it within your namespace as a library, and then your IFC serializer class (or module) can use include to bring in the Zip module. This then will not collide with any other extension.