There are 4 parts to this section.
Ruby 2.7. Compatible version is 2.7.2 and it can be downloaded at: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
C:\Users\sample_user>ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]
OpenStudio 3.7. The latest stable 3.7 version is 3.7.0 and it can be downloaded at: https://github.com/NREL/OpenStudio/releases/tag/v3.7.0 More recent version of OpenStudio can be found in the OpenStudio release link: https://github.com/NREL/OpenStudio/releases. The PRM is tested against v3.7 and lower.
Once you have both Ruby and OpenStudio installed, the next thing is to connect OpenStudio with Ruby.
Step 1: Navigate to ruby installation directory and find the site_ruby
folder. In Windows, it should be a directory like this:
C:\Ruby27-x64\lib\ruby\site_ruby
Step 2: Create a new ruby file called openstudio.rb
under the site_ruby
folder.
Step 3: Open the openstudio.rb
file and add one line:
require "C:/[Openstudio directory]/Ruby/openstudio.rb"
The directory shall point to the openstudio.rb
file under the OpenStudio installation folder. Revise the path after require
based on your actual installation directory.
You can verify the setting with the following command in the command line.
C:\Users\sample_user> irb
irb(main):001:0> require "openstudio"
=> true
Return true verifies a success on your local setup.
gem install openstudio-standards
The OpenStudio Standard package is hosted on Github as an open-source project. The latest PRM method development is in the Appendix_G branch. You can either clone the branch or download it as a zip package. To run the package, import the path to your ruby script as the example shown below.
require_relative 'C:\\Users\\Documents\\OSSTD_Repo\\lib\\openstudio-stadnards.rb'