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

openstudio load error when running measure

asked 2016-11-16 21:05:34 -0600

antonszilasi's avatar

updated 2017-08-05 07:30:42 -0600

I believe that I have followed the instructions in the measure writing guide carefully, however when I try to test the create baseline building measure I get the error seen in the console of the attached picture.

image description

If the picture is difficult to read: It reads

ruby "C:\Users\szilasia\Desktop\CreateBaselineBuilding\tests\create_baseline_building_test.rb"
Process started >>>
C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- openstudio (LoadError)
    from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Users/szilasia/Desktop/CreateBaselineBuilding/tests/create_baseline_building_test.rb:1:in `<main>'
<<< Process finished. (Exit code 1)

It seems as though Ruby can't load the openstudio module under in the path C:\Program Files\OpenStudio 1.13.0\Ruby. Am I correct?

What could be the cause of this?

Any pointers would be most appreciated I am new to Ruby so probably I am missing something.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-11-16 22:04:58 -0600

updated 2016-11-17 14:06:57 -0600

antonszilasi's avatar

It looks like you're using Ruby 2.3. OpenStudio 1.13 is currently compatible with Ruby 2.0 (link).

Try uninstalling 2.3 and installing 2.0 using the Optional - Install Ruby instructions.

edit flag offensive delete link more

Comments

@MatthewSteen thanks for your reply, unfortunately it still doesn't work I have the same error, I am just trying to test my code in Notepad++ before I apply it to OpenStudio is this the right approach?

Ruby is installed on C:\Ruby200-x64 and it works fine when not running a OpenStudio script

antonszilasi's avatar antonszilasi  ( 2016-11-17 13:42:12 -0600 )edit
1

Did you do these steps:

  1. Create a text file with the following text inside:

require 'C:\Program Files (x86)\OpenStudio 1.7.0\Ruby\openstudio.rb'

  1. Save the file as openstudio.rb here: C:\Ruby200\lib\ruby\site_ruby\openstudio.rb (next to the 2.0.0 folder).
aparker's avatar aparker  ( 2016-11-17 16:04:29 -0600 )edit

@antonszilasi follow the instructions I linked above to connect OpenStudio with your Ruby install as Andrew mentions above.

MatthewSteen's avatar MatthewSteen  ( 2016-11-17 16:27:40 -0600 )edit

@aparker@antonszilasi

I followed your instructions, it still refuses to run however now the error is simply

C:/Users/szilasia/OpenStudio/Measures/Create DOE Prototype Building/measure.rb:3:in `<main>': uninitialized constant OpenStudio (NameError)

My environment variable is Ruby: C:\Program Files (x86)\OpenStudio 1.13.0\ruby-install\ruby\bin

and the text file placed under: C:\Ruby200-x64\lib\ruby\site_ruby which simply says: require 'C:\Program Files (x86)\OpenStudio 1.13.0\Ruby\openstudio.rb'

What else could be going wrong?

antonszilasi's avatar antonszilasi  ( 2016-11-21 12:02:18 -0600 )edit

Do you have the 32 bit or 64 bit version of OS 1.13.0 installed? If the latter, remove the (x86) from your path.

MatthewSteen's avatar MatthewSteen  ( 2016-11-21 12:48:35 -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

2 followers

Stats

Asked: 2016-11-16 21:05:34 -0600

Seen: 537 times

Last updated: May 31 '17