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

Error when Measure run in Notepad++

asked 2020-08-26 22:24:10 -0600

riteshsahoo gravatar image

updated 2020-09-04 04:29:18 -0600

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

edit retag flag offensive 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 gravatar image riteshsahoo  ( 2020-09-04 04:29:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2020-08-27 10:33:00 -0600

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.

edit flag offensive delete link more

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 gravatar image riteshsahoo  ( 2020-09-04 04:16:32 -0600 )edit

Your Answer

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

Add Answer

 

Question Tools

3 followers

Stats

Asked: 2020-08-26 22:24:10 -0600

Seen: 980 times

Last updated: Sep 04 '20