Repository: NREL/OpenStudio (language: python)

Issue:
--bundle option does not work after Ruby 3.2.2 update
This does not work...

```
cd src/cli/test/bundle
bundle  _2.4.10_  install --path ./test_gems
../../../../build/Products/openstudio  --bundle Gemfile  --bundle_path './test_gems' test.rb
```


Discussion / hints:

Fix patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3bf7cfd2c3e..b0a4042af39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -835,7 +835,7 @@ if(BUILD_CLI)
   set(OPENSTUDIO_GEMS_BASEURL "http://openstudio-resources.s3.amazonaws.com/dependencies")
 
   # TODO: temp
-  set(OPENSTUDIO_GEMS_BASEURL "https://github.com/NREL/openstudio-gems/releases/download/v3.8.0-RC1-2")
+  set(OPENSTUDIO_GEMS_BASEURL "https://github.com/NREL/openstudio-gems/releases/download/v3.8.0-RC1-4")
 
   # To use the package produced by a PR to https://github.com/NREL/openstudio-gems
   set(USE_OPENSTUDIO_GEMS_PR FALSE)
@@ -847,19 +847,19 @@ if(BUILD_CLI)
   if(UNIX)
      if(APPLE)
        if (ARCH MATCHES arm64)
-         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240419-darwin_arm64-3.2.2.tar.gz")
-         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "b69b353bf99c0f53614d1cb0afd27878")
+         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240422-darwin_arm64-3.2.2.tar.gz")
+         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "0bd06dbf57809e563390efcb0edff5f2")
        else()
-         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240419-darwin-3.2.2.tar.gz")
-         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "55fb8df70fa5477bf9a37aa243ad0818")
+         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240422-darwin-3.2.2.tar.gz")
+         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "e369d60df4f279181a4b17d26dfadf0a")
        endif()
      else()
        if (ARCH MATCHES "arm64")
-         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240214-linux_arm64-3.2.2.tar.gz")
+         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240422-linux_arm64-3.2.2.tar.gz")
          set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "TDB")
        else()
-         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240419-linux-3.2.2.tar.gz")
-         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "ba6dbd7d139f298585f0be14913ea5b3")
+         set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240422-linux-3.2.2.tar.gz")
+         set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "ebdce5e1f4e2f4744d8a3541329def4a")
        endif()
        if (USE_OPENSTUDIO_GEMS_PR)
          set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-linux/${OPENSTUDIO_GEMS_PR_NUMBER}")
@@ -867,8 +867,8 @@ if(BUILD_CLI)
      endif()
   elseif(WIN32)
     # OpenStudio gems are only supported on 64 bit windows
-    set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240419-windows-3.2.2.tar.gz")
-    set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "67f2980b5fd2df23df6a82044e4e0e8b")
+    set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20240422-windows-3.2.2.tar.gz")
+    set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "bf8c5c33321105d1ac35ddc644786067")
     if (USE_OPENSTUDIO_GEMS_PR)
       set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-windows/${OPENSTUDIO_GEMS_PR_NUMBER}")
     endif()
diff --git a/ruby/bindings/InitRubyBindings.cpp b/ruby/bindings/InitRubyBindings.cpp
index 55b42d65ca1..f9b95d08d12 100644
--- a/ruby/bindings/InitRubyBindings.cpp
+++ b/ruby/bindings/InitRubyBindings.cpp
@@ -446,6 +446,10 @@ end # module OpenStudio
 
 void initEmbeddedGems() {
 
+  // Note: We instantiate a global $logger here
+  // It used to be a ruby Logger (require 'logger'), and we would have needed to set the log level based on the CLI parameters passed
+  // Instead, I mimic it by providing a convenience class that forwards to the OpenStudio logger, which takes care of the log level
+
   std::string initScript = R"ruby(
 # This is the save puts to use to catch EPIPE. Uses `puts` on the given IO object and safely ignores any Errno::EPIPE
 #
@@ -467,15 +471,52 @@ def safe_puts(message=nil, opts=nil)
   end
 end
 
-require 'logger'
 require 'rbconfig'
 
-$logger = Logger.new(STDOUT)
-#$logger.level = Logger::ERROR
-$logger.level = Logger::WARN
+# require 'logger'
+# $logger = Logger.new(STDOUT)
+# $logger.level = Logger::DEBUG #WARN
+# Mimic ruby Logger, but forward to OpenStudio, so we don't have to worry about setting the LogLevel
+class ConvenienceLogger
+
+  attr_accessor :level
+
+  def initialize(log_level)
+    @level = log_level
+  end
+
+  def trace?
+    @level <= OpenStudio::Trace
+  end
+
+  def debug(msg)
+    OpenStudio::logFree(OpenStudio::Debug, "ruby", msg)
+  end
+
+  def info(msg)
+    OpenStudio::logFree(OpenStudio::Info, "ruby", msg)
+  end
+
+  def warn(msg)
+    OpenStudio::logFree(OpenStudio::Warn, "ruby", msg)
+  end
+
+  def error(msg)
+    OpenStudio::logFree(OpenStudio::Error, "ruby", msg)
+  end
+
+  def fatal(msg)
+    OpenStudio::logFree(OpenStudio::Fatal, "ruby", msg)
+  end
+
+end
+$logger = ConvenienceLogger.new(OpenStudio::Logger.instance.standardOutLogger.logLevel.get)
 
 # debug Gem::Resolver, must go before resolver is required
-#ENV['DEBUG_RESOLVER'] = "1"
+if $logger.trace?
+  ENV['DEBUG_RESOLVER'] = "1"
+end
+
 original_arch = nil
 if RbConfig::CONFIG['arch'] =~ /x64-mswin64/
   # assume that system ruby of 'x64-mingw32' architecture was used to create bundle
@@ -621,12 +662,12 @@ void locateEmbeddedGems(bool use_bundler) {
           s = eval(spec)
 
           # These require io-console, which we don't have on Windows
-	  if Gem.win_platform?
+          if Gem.win_platform?
               next if s.name == 'reline'
               next if s.name == 'debug'
               next if s.name == 'irb'
               next if s.name == 'readline'
-	  end
+          end
 
           s.loaded_from = f
           # This is shenanigans because otherwise rubygems will think extensions are missing
@@ -715,13 +756,19 @@ void locateEmbeddedGems(bool use_bundler) {
 
     embedded_gems_to_activate.each do |spec|
       if spec.name == "bundler"
-        $logger.debug "Activating gem #{spec.spec_file}"
+        $logger.debug "Activating Bundler gem #{spec.spec_file}"
+        if $logger.trace?
+          pp spec
+        end
         begin
           # Activate will manipulate the $LOAD_PATH to include the gem
           spec.activate
-        rescue Gem::LoadError
+        rescue Gem::LoadError => e
           # There may be conflicts between the bundle and the embedded gems,
           # those will be logged here
+          exception_msg = "Error activating gem #{spec.spec_file}: #{e.class}: #{e.message}\nTraceback:\n"
+          exception_msg += e.backtrace.join("\n")
+          STDERR.puts exception_msg
           $logger.error "Error activating gem #{spec.spec_file}"
           activation_errors = true
         end
@@ -755,6 +802,8 @@ void locateEmbeddedGems(bool use_bundler) {
     require 'bundler/definition'
     require 'bundler/dsl'
     require 'bundler/uri_credentials_filter'
+    require 'bundler/uri_normalizer'
+    require 'bundler/index'
     require 'bundler'
 
     begin
@@ -764,6 +813,10 @@ void locateEmbeddedGems(bool use_bundler) {
       # 2) find_file("Gemfile", "gems.rb")
       #require 'bundler/setup'
 
+      if $logger.trace?
+        Bundler.ui.level = "debug"
+      end
+
       groups = Bundler.definition.groups
       keep_groups = []
       without_groups = ENV['BUNDLE_WITHOUT']
diff --git a/src/cli/UpdateCommand.cpp b/src/cli/UpdateCommand.cpp
index 6037ee60031..5e3deea03ee 100644
--- a/src/cli/UpdateCommand.cpp
+++ b/src/cli/UpdateCommand.cpp
@@ -72,9 +72,10 @@ begin
 rescue SystemExit
   # puts "help was called"
 rescue Exception => e
-  puts
-  puts "Error: #{{e.message}}"
-  puts "Backtrace:\n\t" + e.backtrace.join("\n\t")
+  STDERR.puts
+  STDERR.puts "#{{e.class}}: #{{e.message}}"
+  STDERR.puts "Backtrace:\n\t" + e.backtrace.join("\n\t")
+  STDERR.flush
   raise
 end
      )",


Test patch:
diff --git a/ruby/test/ApplicationPathHelpers_Test.rb b/ruby/test/ApplicationPathHelpers_Test.rb
index 0bf34e4c8c1..d3b116122e5 100644
--- a/ruby/test/ApplicationPathHelpers_Test.rb
+++ b/ruby/test/ApplicationPathHelpers_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ApplicationPathHelpers_Test < MiniTest::Unit::TestCase
+class ApplicationPathHelpers_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Attribute_Test.rb b/ruby/test/Attribute_Test.rb
index b895410b027..ef096113f46 100644
--- a/ruby/test/Attribute_Test.rb
+++ b/ruby/test/Attribute_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Attribute_Test < MiniTest::Unit::TestCase
+class Attribute_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Calendar_Test.rb b/ruby/test/Calendar_Test.rb
index 549619863c5..3264b608df0 100644
--- a/ruby/test/Calendar_Test.rb
+++ b/ruby/test/Calendar_Test.rb
@@ -9,7 +9,7 @@
 
 # DLM@what are the options to distinuguish between OpenStudio::Date and built in Date?
 
-class Calendar_Test < MiniTest::Unit::TestCase
+class Calendar_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Checksum_Test.rb b/ruby/test/Checksum_Test.rb
index 11e35ae7da3..d0eb7cb792c 100644
--- a/ruby/test/Checksum_Test.rb
+++ b/ruby/test/Checksum_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Checksum_Test < MiniTest::Unit::TestCase
+class Checksum_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/ClimateZones_Test.rb b/ruby/test/ClimateZones_Test.rb
index 298a958bdce..b86b33e1aa6 100644
--- a/ruby/test/ClimateZones_Test.rb
+++ b/ruby/test/ClimateZones_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ClimateZones_Test < MiniTest::Unit::TestCase
+class ClimateZones_Test < Minitest::Test
 
   def test_basic
 
diff --git a/ruby/test/Comments_Test.rb b/ruby/test/Comments_Test.rb
index 5df5f53496f..e86b83c4d8c 100644
--- a/ruby/test/Comments_Test.rb
+++ b/ruby/test/Comments_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Comments_Test < MiniTest::Unit::TestCase
+class Comments_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Component_Test.rb b/ruby/test/Component_Test.rb
index 762bb2dc149..feb4d36f0f0 100644
--- a/ruby/test/Component_Test.rb
+++ b/ruby/test/Component_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Component_Test < MiniTest::Unit::TestCase
+class Component_Test < Minitest::Test
 
   def test_lightingSchedule_fromScratch
 
diff --git a/ruby/test/Construction_Test.rb b/ruby/test/Construction_Test.rb
index af0c665fa32..02729d62dc6 100644
--- a/ruby/test/Construction_Test.rb
+++ b/ruby/test/Construction_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Construction_Test < MiniTest::Unit::TestCase
+class Construction_Test < Minitest::Test
 
   def test_ConstructionConstructors
 
diff --git a/ruby/test/DateTime_Test.rb b/ruby/test/DateTime_Test.rb
index 15492e7511e..51490df00d9 100644
--- a/ruby/test/DateTime_Test.rb
+++ b/ruby/test/DateTime_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class DateTime_Test < MiniTest::Unit::TestCase
+class DateTime_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Date_Test.rb b/ruby/test/Date_Test.rb
index 7451144ea8f..f50be9bb5c4 100644
--- a/ruby/test/Date_Test.rb
+++ b/ruby/test/Date_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Date_Test < MiniTest::Unit::TestCase
+class Date_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/ElectricLoadCenterDistribution_Test.rb b/ruby/test/ElectricLoadCenterDistribution_Test.rb
index b7986636efb..d379442b3eb 100644
--- a/ruby/test/ElectricLoadCenterDistribution_Test.rb
+++ b/ruby/test/ElectricLoadCenterDistribution_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ElectricLoadCenterDistribution_Test < MiniTest::Unit::TestCase
+class ElectricLoadCenterDistribution_Test < Minitest::Test
 
   def test_ElectricLoadCenterDistribution_Photovoltaics
 
diff --git a/ruby/test/Enum_Test.rb b/ruby/test/Enum_Test.rb
index 1753d4909d4..b6dcd0281ee 100644
--- a/ruby/test/Enum_Test.rb
+++ b/ruby/test/Enum_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Enum_Test < MiniTest::Unit::TestCase
+class Enum_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/EpwFile_Test.rb b/ruby/test/EpwFile_Test.rb
index d0e56958a1c..052fcb7ca70 100644
--- a/ruby/test/EpwFile_Test.rb
+++ b/ruby/test/EpwFile_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class EpwFile_Test < MiniTest::Unit::TestCase
+class EpwFile_Test < Minitest::Test
 
   def setup
     @epwDir = OpenStudio::Path.new(File.join(File.dirname(__FILE__), "../../resources/utilities/Filetypes/"))
diff --git a/ruby/test/ExceptionHandling1_Test.rb b/ruby/test/ExceptionHandling1_Test.rb
index 3603773727f..fa4a9e6310a 100644
--- a/ruby/test/ExceptionHandling1_Test.rb
+++ b/ruby/test/ExceptionHandling1_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Exceptions1_Test < MiniTest::Unit::TestCase
+class Exceptions1_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/ExceptionHandling3_Test.rb b/ruby/test/ExceptionHandling3_Test.rb
index 86832ebddae..7db292c0ee9 100644
--- a/ruby/test/ExceptionHandling3_Test.rb
+++ b/ruby/test/ExceptionHandling3_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Exceptions3_Test < MiniTest::Unit::TestCase
+class Exceptions3_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/ExteriorLights_Test.rb b/ruby/test/ExteriorLights_Test.rb
index ff4436438bd..296bddaecac 100644
--- a/ruby/test/ExteriorLights_Test.rb
+++ b/ruby/test/ExteriorLights_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ExteriorLights_Test < MiniTest::Unit::TestCase
+class ExteriorLights_Test < Minitest::Test
 
   def test_ExteriorLights
     model = OpenStudio::Model::Model.new
diff --git a/ruby/test/Facility_Test.rb b/ruby/test/Facility_Test.rb
index d2b405ce879..924757a15d4 100644
--- a/ruby/test/Facility_Test.rb
+++ b/ruby/test/Facility_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Facility_Test < MiniTest::Unit::TestCase
+class Facility_Test < Minitest::Test
 
   def test_facility_attributes
 
diff --git a/ruby/test/Gltf_Test.rb b/ruby/test/Gltf_Test.rb
index 2ae689c6ebb..8a39b1c411b 100644
--- a/ruby/test/Gltf_Test.rb
+++ b/ruby/test/Gltf_Test.rb
@@ -7,7 +7,7 @@
 require 'json'
 require 'minitest/autorun'
 
-class Gltf_Test < MiniTest::Unit::TestCase
+class Gltf_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/IddEnums_Test.rb b/ruby/test/IddEnums_Test.rb
index fe29042da43..2e23abca2d8 100644
--- a/ruby/test/IddEnums_Test.rb
+++ b/ruby/test/IddEnums_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class IddEnums_Test < MiniTest::Unit::TestCase
+class IddEnums_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/IddObject_Test.rb b/ruby/test/IddObject_Test.rb
index aec32686c03..3211f569d95 100644
--- a/ruby/test/IddObject_Test.rb
+++ b/ruby/test/IddObject_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class IddObject_Test < MiniTest::Unit::TestCase
+class IddObject_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/InteriorPartitionSurface_Test.rb b/ruby/test/InteriorPartitionSurface_Test.rb
index 335b8010796..43a4de3859a 100644
--- a/ruby/test/InteriorPartitionSurface_Test.rb
+++ b/ruby/test/InteriorPartitionSurface_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class InteriorPartitionSurface_Test < MiniTest::Unit::TestCase
+class InteriorPartitionSurface_Test < Minitest::Test
 
   def test_hierarchy
     workspace = OpenStudio::Workspace.new
diff --git a/ruby/test/Logger_Test.rb b/ruby/test/Logger_Test.rb
index 0c26f9b8107..4878dd02622 100644
--- a/ruby/test/Logger_Test.rb
+++ b/ruby/test/Logger_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Logger_Test < MiniTest::Unit::TestCase
+class Logger_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Matrix_Test.rb b/ruby/test/Matrix_Test.rb
index fb23377ad17..08c9e57c132 100644
--- a/ruby/test/Matrix_Test.rb
+++ b/ruby/test/Matrix_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Matrix_Test < MiniTest::Unit::TestCase
+class Matrix_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Optional_Test.rb b/ruby/test/Optional_Test.rb
index 8ebcffc7dbd..ba3eb5c0d43 100644
--- a/ruby/test/Optional_Test.rb
+++ b/ruby/test/Optional_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Optional_Test < MiniTest::Unit::TestCase
+class Optional_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Path_Test.rb b/ruby/test/Path_Test.rb
index 9b0561db792..f4ee2b374f4 100644
--- a/ruby/test/Path_Test.rb
+++ b/ruby/test/Path_Test.rb
@@ -14,7 +14,7 @@ def changeTestPath(p)
   return p
 end
 
-class Path_Test < MiniTest::Unit::TestCase
+class Path_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/QuantityRegex_Test.rb b/ruby/test/QuantityRegex_Test.rb
index 253888bd043..19e21db47ac 100644
--- a/ruby/test/QuantityRegex_Test.rb
+++ b/ruby/test/QuantityRegex_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class QuantityRegex_Test < MiniTest::Unit::TestCase
+class QuantityRegex_Test < Minitest::Test
   # def setup
   # end
 
diff --git a/ruby/test/Quantity_Test.rb b/ruby/test/Quantity_Test.rb
index 6d3832dc146..6aa5ba1df13 100644
--- a/ruby/test/Quantity_Test.rb
+++ b/ruby/test/Quantity_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Quantity_Test < MiniTest::Unit::TestCase
+class Quantity_Test < Minitest::Test
   def setup
     @tol = 1.0E-5
   end
diff --git a/ruby/test/RubyOperations_Test.rb b/ruby/test/RubyOperations_Test.rb
index 54fb7c3979f..8fc92a125b0 100644
--- a/ruby/test/RubyOperations_Test.rb
+++ b/ruby/test/RubyOperations_Test.rb
@@ -9,7 +9,7 @@
 
 require 'minitest/autorun'
 
-class RubyOperations_Test < MiniTest::Unit::TestCase
+class RubyOperations_Test < Minitest::Test
 
   def test_ModelObjectUniq
 
diff --git a/ruby/test/ScaleFactory_Test.rb b/ruby/test/ScaleFactory_Test.rb
index 9a8a4d22048..b121e708e6f 100644
--- a/ruby/test/ScaleFactory_Test.rb
+++ b/ruby/test/ScaleFactory_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ScaleFactory_Test < MiniTest::Unit::TestCase
+class ScaleFactory_Test < Minitest::Test
   # def setup
   # end
 
diff --git a/ruby/test/ScheduleConstant_Test.rb b/ruby/test/ScheduleConstant_Test.rb
index e0b176ba81f..b47af7eb5fd 100644
--- a/ruby/test/ScheduleConstant_Test.rb
+++ b/ruby/test/ScheduleConstant_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class ScheduleConstant_Test < MiniTest::Unit::TestCase
+class ScheduleConstant_Test < Minitest::Test
 
   def test_ScheduleConstant
     model = OpenStudio::Model::Model.new
diff --git a/ruby/test/SimulationControl_Test.rb b/ruby/test/SimulationControl_Test.rb
index e4f1b1ad228..473500132a6 100644
--- a/ruby/test/SimulationControl_Test.rb
+++ b/ruby/test/SimulationControl_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class SimulationControl_Test < MiniTest::Unit::TestCase
+class SimulationControl_Test < Minitest::Test
 
   def test_construct_through_child
 
diff --git a/ruby/test/Site_Test.rb b/ruby/test/Site_Test.rb
index 8333c65874f..8f5b3d7aa62 100644
--- a/ruby/test/Site_Test.rb
+++ b/ruby/test/Site_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Site_Test < MiniTest::Unit::TestCase
+class Site_Test < Minitest::Test
 
   def test_construct_all_children
 
diff --git a/ruby/test/SkyTemperature_Test.rb b/ruby/test/SkyTemperature_Test.rb
index 037d889bfe0..47bc3ec6cf0 100644
--- a/ruby/test/SkyTemperature_Test.rb
+++ b/ruby/test/SkyTemperature_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class SkyTemperature_Test < MiniTest::Unit::TestCase
+class SkyTemperature_Test < Minitest::Test
 
   def test_construction_and_parentage
 
diff --git a/ruby/test/Space_Test.rb b/ruby/test/Space_Test.rb
index b83e32d064e..d5021d4b3c6 100644
--- a/ruby/test/Space_Test.rb
+++ b/ruby/test/Space_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Space_Test < MiniTest::Unit::TestCase
+class Space_Test < Minitest::Test
 
   def test_Space
     workspace = OpenStudio::Workspace.new
diff --git a/ruby/test/Surface_Test.rb b/ruby/test/Surface_Test.rb
index 26dc226d62f..6dfc5039dc6 100644
--- a/ruby/test/Surface_Test.rb
+++ b/ruby/test/Surface_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Surface_Test < MiniTest::Unit::TestCase
+class Surface_Test < Minitest::Test
 
   def test_Surfaces
     model = OpenStudio::Model::exampleModel
diff --git a/ruby/test/TimeSeries_Test.rb b/ruby/test/TimeSeries_Test.rb
index 2a6ae878a13..aa0008e0fa2 100644
--- a/ruby/test/TimeSeries_Test.rb
+++ b/ruby/test/TimeSeries_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class TimeSeries_Test < MiniTest::Unit::TestCase
+class TimeSeries_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Time_Test.rb b/ruby/test/Time_Test.rb
index 6e27319bfef..489ca008fdd 100644
--- a/ruby/test/Time_Test.rb
+++ b/ruby/test/Time_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Time_Test < MiniTest::Unit::TestCase
+class Time_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Transformation_Test.rb b/ruby/test/Transformation_Test.rb
index ad515ef737d..711a0bf9938 100644
--- a/ruby/test/Transformation_Test.rb
+++ b/ruby/test/Transformation_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Transformation_Test < MiniTest::Unit::TestCase
+class Transformation_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/UUID_Test.rb b/ruby/test/UUID_Test.rb
index 18b51d684fb..7e7205fc6fe 100644
--- a/ruby/test/UUID_Test.rb
+++ b/ruby/test/UUID_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class UUID_Test < MiniTest::Unit::TestCase
+class UUID_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Unit_Test.rb b/ruby/test/Unit_Test.rb
index 4fb9cb425f9..4b5e972e332 100644
--- a/ruby/test/Unit_Test.rb
+++ b/ruby/test/Unit_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Unit_Test < MiniTest::Unit::TestCase
+class Unit_Test < Minitest::Test
   # def setup
   # end
 
diff --git a/ruby/test/Vector_Test.rb b/ruby/test/Vector_Test.rb
index 72d5e9f6db4..8692b8f11fc 100644
--- a/ruby/test/Vector_Test.rb
+++ b/ruby/test/Vector_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Vector_Test < MiniTest::Unit::TestCase
+class Vector_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/WorkspaceObjectWatcher_Test.rb b/ruby/test/WorkspaceObjectWatcher_Test.rb
index 855c6813f54..60a03c5cb10 100644
--- a/ruby/test/WorkspaceObjectWatcher_Test.rb
+++ b/ruby/test/WorkspaceObjectWatcher_Test.rb
@@ -58,7 +58,7 @@ def onRemoveFromWorkspace(handle)
   end
 end
 
-class WorkspaceObjectWatcher_Test < MiniTest::Unit::TestCase
+class WorkspaceObjectWatcher_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/Workspace_Test.rb b/ruby/test/Workspace_Test.rb
index 5af83fe0394..898a35c6fe3 100644
--- a/ruby/test/Workspace_Test.rb
+++ b/ruby/test/Workspace_Test.rb
@@ -7,7 +7,7 @@
 
 require 'minitest/autorun'
 
-class Workspace_Test < MiniTest::Unit::TestCase
+class Workspace_Test < Minitest::Test
 
   # def setup
   # end
diff --git a/ruby/test/epJSON_Test.rb b/ruby/test/epJSON_Test.rb
index 381b1601101..4b6b6834a33 100644
--- a/ruby/test/epJSON_Test.rb
+++ b/ruby/test/epJSON_Test.rb
@@ -7,7 +7,7 @@
 require 'json'
 require 'minitest/autorun'
 
-class EpJSON_Test < MiniTest::Unit::TestCase
+class EpJSON_Test < Minitest::Test
 
   def setup
 
diff --git a/src/cli/test/bundle/Gemfile b/src/cli/test/bundle/Gemfile
index 9901881f03d..98fd9c91490 100644
--- a/src/cli/test/bundle/Gemfile
+++ b/src/cli/test/bundle/Gemfile
@@ -1,4 +1,3 @@
 source 'http://rubygems.org'
 
-gem 'openstudio-workflow', '2.2.0' # This is compatible with bundler 2.1 (OS 3.x), and already older than currently used at this time
 gem 'tilt', '2.0.8'
diff --git a/src/cli/test/bundle/test.rb b/src/cli/test/bundle/test.rb
index 6c5bbefbe88..208e668d232 100644
--- a/src/cli/test/bundle/test.rb
+++ b/src/cli/test/bundle/test.rb
@@ -20,4 +20,4 @@ def local_gems
 require 'openstudio'
 require 'openstudio-workflow'
 puts OpenStudio::Workflow::VERSION
-raise "OpenStudio Workflow gem version does not match" unless OpenStudio::Workflow::VERSION == '2.2.0'
+raise "OpenStudio Workflow gem version does not match" unless OpenStudio::Workflow::VERSION == '2.4.0'
diff --git a/src/cli/test/test_with_analysis.py b/src/cli/test/test_with_analysis.py
index 41f1677f896..4cdf1237f7e 100644
--- a/src/cli/test/test_with_analysis.py
+++ b/src/cli/test/test_with_analysis.py
@@ -152,6 +152,8 @@ def test_run_log_debug(osclipath, is_labs: bool):
     run_log_path = runDir / "run.log"
     assert run_log_path.is_file()
     run_log = run_log_path.read_text()
+    # Filter out the debug InitRubyBindings
+    run_log = "\n".join([x for x in run_log.splitlines() if ' [ruby] ' not in x])
     assert "No results for objective function IsNonExisting.NonExisting" in run_log
     assert "runner.registerWarning called" in run_log
     assert 50 < len(run_log.splitlines()) < 100
@@ -185,6 +187,8 @@ def test_run_log_toplevel_verbose(osclipath, is_labs: bool):
     run_log_path = runDir / "run.log"
     assert run_log_path.is_file()
     run_log = run_log_path.read_text()
+    # Filter out the debug InitRubyBindings
+    run_log = "\n".join([x for x in run_log.splitlines() if ' [ruby] ' not in x])
     assert "No results for objective function IsNonExisting.NonExisting" in run_log
     assert "runner.registerWarning called" in run_log
     if not is_labs: