First time here? Check our help page!
2

Error when Measure run in Notepad++

Hi I get the following error when run in Notepad++ There is a openstudio.so file already in the path : C:/openstudioapplication-1.0.0Test12/Ruby/openstudio.so but still i get the error.

ruby "$(FULL_CURRENT_PATH)"
ruby "C:\Users\AWE\OpenStudio\Measures\life_cycle_report\tests\ExampleReport_Test.rb"
Process started (PID=21492) >>>
C:/openstudioapplication-1.0.0Test12/Ruby/openstudio.rb:55:in `require_relative': 126: The specified module could not be found.      - C:/openstudioapplication-1.0.0Test12/Ruby/openstudio.so (LoadError)
  from C:/openstudioapplication-1.0.0Test12/Ruby/openstudio.rb:55:in `<top (required)>'
  from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from C:/Users/AWE/OpenStudio/Measures/life_cycle_report/tests/ExampleReport_Test.rb:36:in `<main>

image descriptionimage description

riteshsahoo's avatar
235
riteshsahoo
asked 2020-08-26 22:24:10 -0500, updated 2020-09-04 04:29:18 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Where can i find the external library files ? I am unable to view the available functions for a variable. Please help

riteshsahoo's avatar riteshsahoo (2020-09-04 04:29:16 -0500) edit
add a comment see more comments

1 Answer

3

If you just want to access the OpenStudio SDK via Ruby, you would require openstudio.rb like what is shown in this IRB.

irb(main):002:0> require "/Applications/OpenStudioApplication-1.0.0/Ruby/openstudio.rb"
/Applications/OpenStudioApplication-1.0.0/Ruby/openstudio.rb:31: warning: Insecure world writable dir /Applications/ParametricAnalysisTool-3.0.0/ParametricAnalysisTool.app/Contents/Resources/OpenStudio-server/bin in PATH, mode 040777
=> true
irb(main):003:0>

As a note, if you plan to use the openstudio-standards gem you will have to install that in your system ruby. An alternative you may consider is calling your script with command call of openstudio my_script.rb instead of ruby my_scxript.rb. OpenStudio will run the script with its own embedded ruby interpreter which will already be configured with both openstudio-standards gem and openstudio-extenstion gem. This allows you to run measure tests or other scripts you make without having to have a system Ruby installed on your computer. It also makes sure you are using the version or Ruby that particular version of OpenStudio expects.

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2020-08-27 10:33:00 -0500
edit flag offensive 0 remove flag delete link

Comments

If i run using the openstudio command in the Notepad++ I get the following error

C:\Users\AWE>openstudio C:\Users\AWE\OpenStudio\Measures\life_cycle_report\tests\ExampleReport_Test.rb Traceback (most recent call last): 1: from C:/openstudioapplication-1.0.0/Ruby/openstudio.rb:55:in <main>' C:/openstudioapplication-1.0.0/Ruby/openstudio.rb:55:inrequire_relative': 126: The specified module could not be found. - C:/openstudioapplication-1.0.0/Ruby/openstudio.so (LoadError)

riteshsahoo's avatar riteshsahoo (2020-09-04 04:16:32 -0500) edit
add a comment see more comments