I have installed Gems in Sketchup but cant use stringio because there is a need for an update
See:
require ‘stringio’
false
But is is loaded in my
and the following:
Gem.install “stringio”
Error: #<Gem::InstallError: stringio requires RubyGems version >= 2.6. Try ‘gem update --system’ to update RubyGems itself.>
Looking into my folder:
C:\Users\gva\AppData\Roaming\SketchUp\SketchUp 2017\SketchUp\Gems64
it tells me the gems are installed but i cant use them not even in an administrative startup
The suggested alternative for installing: ruby library 2.7.8 for Sketchup fails
Also tried to change the:
C:\Program Files\SketchUp\SketchUp 2017\Tools\RubyStdLib\platform_specific\rbconfig.rb eb set the platoform params from 2.2.4 to 2.7.8
I think it was said in other threads on gems that basically all current versions of Ruby used in SketchUp 2018 and earlier are beyond end of maintenance (according the to Ruby Core world) and so are not being supported by RubyGems.
(This means more and more gems will no longer be installable in older SketchUp versions, ie versions using non-RubyGems supported Ruby.)
SketchUp uses a modified build of RubyGems, and the “rbconfig.rb” file is not entirely correct (has invalid values in it for the SketchUp environment.)
Shoehorning a newer Ruby version is not likely to work as it will invalidate SketchUp itself and any extension that has been tested and released to run under the Ruby version distributed with SketchUp.
Suggest you start another thread on the specific needs you have regarding strings. Perhaps there is a work around ?
Yes, StringIO is available as a gem, but it is an ‘extension gem’, so it requires build tools (compilers, additional libraries, etc, often called DevKit) to compile it. Build tools are not shipped with SketchUp.
RbConfig (rbconfig.rb) - “platform params from 2.2.4 to 2.7.8” - in this instance ‘2.2.4’ is referring to a Ruby version, ‘2.7.8’ is referring to a RubyGems version.
RbConfig (rbconfig.rb) - I would strongly suggest not changing rbconfig.rb without saving a backup, especially if you don’t know what each setting is used for.
Use Object.const_defined?(:StringIO) to see if StringIO is already loaded.
The current implementation of Ruby in SketchUp does allow a knowledgeable user to install just about anything, but it may not be trivial. Hence, unless these changes/installs are restricted to a small set of users (like a group of co-workers), they can’t be used in a publicly facing SketchUp extension/plug-in…
Aside from the issue of whether that is the Ruby vs the Gem version, that change is not legitimate because it doesn’t change the actual Ruby version that is built into SketchUp it just lies about what it is!