true
“no implicit conversion of Sketchup::Console into String (Line 1)”
Error: #<TypeError: no implicit conversion of TypeError into String>
“myuser”/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/as_rubyeditor/as_rubyeditor.rb:346:in +' "myuser"/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/as_rubyeditor/as_rubyeditor.rb:346:in rescue in block in initialize’
“myuser”/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/as_rubyeditor/as_rubyeditor.rb:335:in `block in initialize’
The SKETCHUP_CONSOLE object takes control of STDIN and STDOUT.
So apparently the standard library Logger is not compatible with SketchUp’s embedded Ruby process.
Likely because the console is not a subclass of the IO class.
Use standalone Ruby (matching the versions for your target SketchUp) and install the gem there. Then you can copy the gem to your extension.
How can I do it? system('gem install aws-sdk-s3') installs in Sketchup’s Gems directory.
Also, the same Ruby version might not be installed at the user’s end.
What I recommend is that you modify the gem to be wrapped in your extension’s namespace. Just building and installing it locally and bundling it isn’t enough as you’d still have the issue namespace collisions.
What Thomas (@tt_su) said is correct, re the namespace collisions.
Have a look at a recent CI test run for the SDK. I think there are eight instances of ‘with native extensions’, which means that eight of the gems that are dependencies of the SDK are extension gems, which require compiling. Some could be dependencies used just for testing, but they don’t look like they are (see the Gemfile).
Re compiling extension gems, new versions of SU Ruby are mswin builds, most gems don’t test against mswin, but against mingw64 or ucrt64. So, they may not build, or, if they build, they may not work. Some don’t even test against Windows Ruby.
One might be able to set ENV['PURE_RUBY'] = '1' and install the SDK, but that may be slow, since the json and xml parsing will be done in Ruby code, not compiled c. And possibly other things…
Lastly, the SDK is divided into quite a few gems (see https://rubygems.org/search?query=aws-sdk). Installing a portion of the SDK might be an easier task.