Openstudio measure needs to access system variables

asked 4 years ago

updated 4 years ago

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?

Preview: (hide)

Comments

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

mdahlhausen's avatar mdahlhausen  ( 4 years ago )

Ruby: 2.2.6p396 OpenStudioApp: v2.9.0

mapascual's avatar mapascual  ( 4 years ago )

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  ( 4 years ago )