In OpenStudio v2.+, ruby comes installed with OpenStudio, and the ruby directory lives in the OpenStudio install. When you require 'openstudio', it seems like you are asking your C:\Ruby200-x64 install to access the openstudio file located in your OpenStudio v2.+ install.

In OpenStudio v2.+, instead of adding require 'openstudio' to the top of your ruby script and running ruby foo_script.rb, you can just run openstudio foo_script.rb.

Comments

Thank you, mdahlhausen. I didn't know that ruby comes installed with OpenStudio v2.+. I uninstalled C:\Ruby200-x64. How can I test my OpenStudio Ruby installation? In C:\openstudio-2.2.0\Ruby, I have openstudio.rb and openstudio.so. The files were associated with NotePad++, but I just changed that to openstudio.exe. When I run openstudio 'openstudio.rb', I get still get this:

Error: 126: The specified module could not be found. - C:/openstudio-2.2.0/Ruby/openstudio.so

openstudio i̶s̶ ̶a̶n̶ i̶n̶s̶t̶a̶n̶c̶e̶ ̶o̶f̶ ̶r̶u̶b̶y̶ [Edit: per Dan's comment below, has an embedded not-full-featured ruby]; you don't need to call openstudio 'openstudio.rb'. Just put whatever you want to change with the API in a script and run that.

Thanks, mdahlhausen. I didn't realize openstudio was an instance of ruby. I just wanted to make sure that my OpenStudio installation was complete. I thought my ruby installation was malfunctioning and causing the OpenStudio GUI to not show anything in the Geometry tab of a model I created from a DOE residential prototype building IDF file. I thought IDF importing worked for everything but HVAC, but I have since read some other resources stating that Stories and Geometry also don't import.

Comments

Thank you, shorowit. I do have C:\openstudio-2.2.0\Ruby\openstudio.so. The above thread with mdahlhausen resolved my issue. Thanks for that link. If I end up needing to use the ruby API, I'll use the ruby version listed there.

I think that was the issue Scott, looks like Ruby 2.0.0 was installed but 2.2.4 is required to work with that version of OpenStudio. The "Cannot find *.so" message doesn't always literally mean it can't find the file, it might mean it can't load it due to wrong version or missing dependencies.