Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

Measure Test File Not Working with OS 2.1.0

asked 2017-04-20 15:16:17 -0600

Alec's avatar

updated 2017-08-05 07:57:24 -0600

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:

C:/openstudio-2.1.0/Ruby/openstudio.rb:55:in `require_relative': 193: %1 is not a valid Win32 application. - C:/openstudio-2.1.0/Ruby/openstudio.so (LoadError)

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:

Run options: --seed 13881

Running:

Finished in 0.000000s, NaN runs/s, NaN assertions/s.

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips

edit retag flag offensive close merge delete

Comments

I also had trouble with migrating to OpenStudio 2.1.0. In my case, I downgraded the ruby to 2.2.4, then It worked for me. Hope someone in charge will provide correct advice.

miwamasa's avatar miwamasa  ( 2017-04-21 01:37:47 -0600 )edit

OpenStudio 2.1.0 uses Ruby 2.2.4 (from the release notes).

ericringold's avatar ericringold  ( 2017-04-21 09:39:21 -0600 )edit

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.

Alec's avatar Alec  ( 2017-04-21 10:56:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-04-22 11:22:44 -0600

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?

edit flag offensive delete link more

Comments

Also, it is not recommended to use the Ruby that is shipped with OpenStudio. That is only shipped to support running PAT and will be removed once all the required functionality is included in the CLI.

macumber's avatar macumber  ( 2017-04-22 11:23:43 -0600 )edit

I added the RUBYLIB environment variable, but the test still did not complete successfully. I do have tests defined in the file; the test file would successfully run the measure with OS 1.14.

Running the test file from the CLI seemed to work, so I will proceed with that solution. Thank you.

Alec's avatar Alec  ( 2017-04-24 08:56:41 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

Stats

Asked: 2017-04-20 15:16:17 -0600

Seen: 255 times

Last updated: Apr 22 '17