Gem install issue

Hey guys,

I’m facing a issue when trying to install a gem ‘rubyzip’ on SU 2021.

Follow the console log:

Gem.install “rubyzip”
[#<Gem::Specification:0x000002327a28f150 @extension_dir=“C:/Users/Us\xFAario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Gems64/extensions/x64-mswin64-140/2.7.0/rubyzip-2.3.0”,
@full_gem_path=“C:/Users/Us\xFAario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Gems64/gems/rubyzip-2.3.0”,
@cache_file=nil,
@gems_dir=“C:/Users/Us\xFAario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Gems64/gems”,
@base_dir=“C:/Users/Us\xFAario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Gems64”,
@loaded_from=“C:/Users/Us\xFAario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Gems64/specifications/rubyzip-2.3.0.gemspec”,
@original_platform=“ruby”,
@installed_by_version=#<Gem::Version “3.1.2”>,
@autorequire=nil,
@date=2020-03-14 00:00:00 UTC,
@deion=nil,
@email=[“alex@simonov.me”],
@homepage=“GitHub - rubyzip/rubyzip: Official Rubyzip repository”,
@name=“rubyzip”,
@post_install_message=nil,
@signing_key=nil,
@summary=“rubyzip is a ruby module for reading and writing zip files”,
@version=#<Gem::Version “2.3.0”>,
@authors=[“Alexander Simonov”],
@bindir=“bin”, @cert_chain=,
@dependencies=[<Gem::Dependency type=:development name=“coveralls” requirements=“~> 0.7”>,
<Gem::Dependency type=:development name=“minitest” requirements=“~> 5.4”>,
<Gem::Dependency type=:development name=“pry” requirements=“~> 0.10”>,
<Gem::Dependency type=:development name=“rake” requirements=“~> 12.3, >= 12.3.3”>,
<Gem::Dependency type=:development name=“rubocop” requirements=“~> 0.79”>],
@executables=,
@extensions=,
@extra_rdoc_files=,
@files=[“README.md”, “Rakefile”, “TODO”, “lib/zip.rb”, “lib/zip/central_directory.rb”, “lib/zip/compressor.rb”, “lib/zip/constants.rb”, “lib/zip/crypto/decrypted_io.rb”, “lib/zip/crypto/encryption.rb”, “lib/zip/crypto/null_encryption.rb”, “lib/zip/crypto/traditional_encryption.rb”, “lib/zip/decompressor.rb”, “lib/zip/deflater.rb”, “lib/zip/dos_time.rb”, “lib/zip/entry.rb”, “lib/zip/entry_set.rb”, “lib/zip/errors.rb”, “lib/zip/extra_field.rb”, “lib/zip/extra_field/generic.rb”, “lib/zip/extra_field/ntfs.rb”, “lib/zip/extra_field/old_unix.rb”, “lib/zip/extra_field/universal_time.rb”, “lib/zip/extra_field/unix.rb”, “lib/zip/extra_field/zip64.rb”, “lib/zip/extra_field/zip64_placeholder.rb”, “lib/zip/file.rb”, “lib/zip/filesystem.rb”, “lib/zip/inflater.rb”, “lib/zip/input_stream.rb”, “lib/zip/ioextras.rb”, “lib/zip/ioextras/abstract_input_stream.rb”, “lib/zip/ioextras/abstract_output_stream.rb”, “lib/zip/null_compressor.rb”, “lib/zip/null_decompressor.rb”, “lib/zip/null_input_stream.rb”, “lib/zip/output_stream.rb”, “lib/zip/pass_thru_compressor.rb”, “lib/zip/pass_thru_decompressor.rb”, “lib/zip/streamable_directory.rb”, “lib/zip/streamable_stream.rb”, “lib/zip/version.rb”, “samples/example.rb”, “samples/example_filesystem.rb”, “samples/example_recursive.rb”, “samples/gtk_ruby_zip.rb”, “samples/qtzip.rb”, “samples/write_simple.rb”, “samples/zipfind.rb”], @licenses=[“BSD 2-Clause”],
@metadata={“bug_tracker_uri”=>“Issues · rubyzip/rubyzip · GitHub”,
“changelog_uri”=>“rubyzip/Changelog.md at v2.3.0 · rubyzip/rubyzip · GitHub”,
“documentation_uri”=>“File: README — Documentation for rubyzip (2.3.0)”,
“source_code_uri”=>“GitHub - rubyzip/rubyzip at v2.3.0”,
“wiki_uri”=>“Home · rubyzip/rubyzip Wiki · GitHub”}, @platform=“ruby”, @rdoc_options=, @require_paths=[“lib”], @required_ruby_version=#<Gem::Requirement:0x000002327a277528 @requirements=[[“>=”, #<Gem::Version “2.4”>]]>, @required_rubygems_version=#<Gem::Requirement:0x000002327a2770a0 @requirements=[[“>=”, #<Gem::Version “0”>]]>, @requirements=, @rubygems_version=“3.0.3”, @specification_version=4, @test_files=, @new_platform=“ruby”, @full_name=“rubyzip-2.3.0” rubyzip-2.3.0>]

after that, when I start SU the follow message shows:

Error on load file C:/Users/Usúario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Plugins/CollectionPlugin/CollectionPlugin.rb
Error: #<LoadError: cannot load such file – zip>
C:/Program Files/SketchUp/SketchUp 2021/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:92:in require' C:/Program Files/SketchUp/SketchUp 2021/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:92:in require’
C:/Users/Usúario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Plugins/CollectionPlugin/CollectionPlugin.rb:33:in <top (required)>' C:/Program Files/SketchUp/SketchUp 2021/Tools/extensions.rb:197:in require’
C:/Program Files/SketchUp/SketchUp 2021/Tools/extensions.rb:197:in load' C:/Users/Usúario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Plugins/CollectionPlugin.rb:32:in register_extension’
C:/Users/Usúario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Plugins/CollectionPlugin.rb:32:in <module:CriaPlugin>' C:/Users/Usúario/AppData/Roaming/SketchUp/SketchUp 2021/SketchUp/Plugins/CollectionPlugin.rb:14:in <top (required)>’

Has anyone had the same problem?

thank u guys!

Please learn how to post code and monospaced error text to the forum:


The first output you showed, indicates that the gem was correctly installed.

After that callng

require 'zip'

… should have unshifted the path to the RubyZip gem’s “lib” subfolder into the first position of the $LOAD_PATH array, and then loaded …
"%AppData%/SketchUp/SketchUp 2021/SketchUp/Gems64/gems/rubyzip-2.3.0/lib/zip.rb"
… which loads most of the files in the lib’s "zip" subfolder.

Following this, the Zip module should be defined at the top level ObjectSpace.

I just tried it in SU2021 and it worked fine for me.

Suggest you restart SketchUp and retry.

1 Like

I have noted weirdness with the RubyZip gem in the past …

1 Like

Hi Dan,

thanks for reply and I’ll lern!

Let us know if you get it working correctly.

1 Like

I also tried installing and requiring the rubyzip gem and had no problems. It did dump the specification object for the gem to the console, which some may find confusing.

Re RubyGems, it is a pretty stable stdlib, so most normal operations have worked for a long time.

If a ‘require’ loads a file that doesn’t match a gem name, the method Gem.try_activate is called, and it searches all gems for a matching require. If only one match is found, it loads it. Another example is the ‘nio4r’ gem, which loads with require 'nio'

2 Likes

Hi Dan,
Sorry for the late reply!
I didn’t find out how to use rubyzip from rubygems (Gem.install), so I downloaded lib
and I’m using it locally.

Thanks!

Well it would have been nice to know what your issue was.

Could you please explain a little bit further, because i was experiencing the same issue

There is nothing more to explain. Please stay in 1 topic thread.