Openstudio measure needs to access system variables

asked 2020-05-15 05:21:53 -0500

updated 2020-05-15 10:53:36 -0500

I am writing a measure that requires executing an external program. The external program location is determined by a windows environment variable. I am trying to access it using ruby ENV hash. This works fine when running the measure in a unittest but it doesn't work when running the measure inside the openstudio app.

Any ideas?

edit retag flag offensive close merge delete

Comments

what versions of ruby and openstudio / openstudio app are you using?

mdahlhausen's avatar mdahlhausen  ( 2020-05-15 10:48:10 -0500 )edit

Ruby: 2.2.6p396 OpenStudioApp: v2.9.0

mapascual's avatar mapascual  ( 2020-05-15 11:30:11 -0500 )edit

If you are starting the App by double clicking it might not be getting all of your environment variables. Try launching it from a command prompt instead.

I'd suggest logging the ENV in your measure to help debug:

runner.registerInfo("ENV = #{ENV}")

FYI, the environment used to start the OS CLI from the App is set up here

macumber's avatar macumber  ( 2020-05-19 22:22:38 -0500 )edit