Error shown in Ruby at startup

The following is at startup with the Ruby console running.

image

Looks like something @tt_su needs to look at.

Have you updated TT_Lib2 lately? Might be worth a shot. Perhaps delete the old TT_Lib2 first?

The version in the warehouse is 2.12.3 is the version I have.
Same error after R&R.

Hmmm… I have that version too but don’t get that message when I start SketchUp 2022. Seems if it was a problem with TT_Lib2 anyone with that version in SketchUp 2022 would also get that message on startup.

Skalp is also mentioned, removing that did not help.

Does it prevent any of Thom Thom’s extensions from working? Maybe just informative, not an error?

Everything seems to work as intended. Maybe a red herring?

1 Like

It is not an error. The message clearly says “warning”. And this is what exactly it is.
It is hard-coded at the top of the "Win32API.rb" file and nothing any lone developer can do about it.
This warning has been output I think ever since Ruby 2.0 was released which for SketchUp was v2014.

Now, Trimble could have deleted the warning from the "Win32API.rb" file in SketchUp’s Ruby distribution, but they haven’t and it’s all water under the bridge as the entire file has been removed from Ruby 3.x.

So it is likely that the next version of SketchUp will get a version of Ruby somewhere in the 3.x trunk and that file will go “bye bye”. Developers should have long since migrated away from using that file and the Win32API class by now. (But Thomas has been busy with other things, no doubt.)


P.S. - The Skalp message was not connected to the one caused by "Win32API.rb".

2 Likes

Thanks for the explanation!

1 Like

Yea, I probably have to address that warning before Ruby 3 ships with SketchUp. As mentioned, it’s inert in the current versions of SketchUp.

This is a warning, not an error. The extension in question uses some functionality that is going to be removed in favor of some other improved functionality, some day in the future.

This is nothing you need to worry about. If you close the ruby Console it shouldn’t be visible.

1 Like

Just for giggles, the warning can be suppressed (and also avoid a strange error with Rubygems when loading the Win32API wrapper class with require) …

    def load_win32api_wrapper
      return if defined?(Win32API)
      $:.each { |path|
        win32api = File.join(path,'Win32API.rb')
        if File.exist?(win32api)
          begin
            verbosity, $VERBOSE = $VERBOSE, nil
            load win32api
          rescue => err
            raise err
          ensure
            $VERBOSE = verbosity if $VERBOSE != verbosity
          end
          break
        end
      }
    end ### load_win32api_wrapper()