Ruby version

Developing on Windows, what version of Ruby should I be using with SketchUp 2022?
Ruby 3.1.3 or 3.2?

Windows Ruby installer comes in a couple of different installers, rubyinstaller & rubyinstaller-devkit
Is the -devkit installer ok to use or should I go with the standard installer?

Thanks All!

Hi,

In SketchUp 2021.1 the Ruby version was upgraded to 2.7.2

Since then I don’t see any more upgrades for Ruby so SketchUp 2022 might still be using version 2.7.2.

Here is the URL where I found the info: File: Release Notes — SketchUp Ruby API Documentation

Also, SketchUp already has a version of Ruby installed so you do not need to install Ruby manually. If you install Ruby separately then SketchUp will not acknowledge that version of Ruby and it will keep using its own version of Ruby.

4 Likes

Short answer:

  1. Open the Ruby console in SketchUp.
  2. Execute the following: puts RUBY_VERSION

and Ruby will tell you it’s version. My 2022 Pro version says 2.7.2.

Longer answer:

Ruby has (among others) the three global variables RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. When I check the value of the three in SketchUp Pro 2022 I get the following:

puts RUBY_VERSION
2.7.2
=> nil
puts RUBY_RELEASE_DATE
2020-10-01
=> nil
puts RUBY_PLATFORM
x64-mswin64_140
=> nil

“Give a man a fire and he’s warm for a day, but set fire to him and he’s warm for the rest of his life.” - Sir Terry Pratchett

3 Likes

2023 SKU pro version 2023.0.419 64 bit
today says RUBY_VERSION 2.7.7

Yes, because SketchUp release 2023.0.2 upgraded Ruby to 2.7.7.

RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM are mentioned above, which can be helpful if one needs to parse the info.

Stand-alone Ruby has an argument -v which outputs version info and also switches warnings on. Its equivalent in the console is RUBY_DESCRIPTION.

Windows 2023
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x64-mswin64_140]

macOS 2023
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [arm64-darwin21]

1 Like