Measure Test File Not Working with OS 2.1.0

I had measure test files working with 1.14, but then upgraded to 2.1.0 and can't seem to get them to work. I was using the Ruby instance packaged with OS before, but was unable to find the Ruby install with OS 2.1.0. I have installed Ruby 2.2.6 (32-bit) and set up the environment according to the Measure Writing Guide (required the full path to the openstudio.rb file in the measure test file). When I try to run the test file, it gives me the following error:

I suspect it could be an issue with the Ruby version or my Path not correctly pointing to OS, but I'm not sure. Any suggestions?

Update: I installed the 64-bit version of Ruby 2.2.6, which seems to have solved the problem above; however, now the measure does not seem to run from the test file and doesn't provide any error. I get the following output:

I switched my path to use the Ruby bundled with OS 2.1.0, which I found in the PAT folder. I verified that I'm now using Ruby 2.2.4, but I'm still having the same issue where the measure doesn't actually run.

1 Answer

To load OpenStudio Ruby bindings from your system Ruby it is required to install Ruby 2.2.4. You will also have to ensure that the directory containing openstudio.rb (e.g. C:\openstudio-2.1.0\Ruby) is in your Ruby Path, either by setting the environment variable RUBYLIB or passing the path on the command line (e.g. ruby -I "C:/openstudio-2.1.0/Ruby/" measure_test.rb).

Because the OpenStudio CLI has Ruby built in, you can also run measure tests directly from the CLI. Just do openstudio.exe measure_test.rb.

That doesn't explain why your test output is empty, do you have tests defined in your test file?