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

Ruby bindings in OpenStudio SDK error

asked 3 years ago

sashadf1's avatar

updated 3 years ago

Hi all,

I installed Ruby 2.7.3 onto my machine, which is the recommended version. I am using OS 2.9.0. I do not know if the embedded Ruby interpreter in OS 2.9.0 is a different version than 2.7.3 (maybe that is causing my problem).

I am trying to get OS gems/Ruby bindings (not sure the correct terminology here) into my command prompt/interactive ruby so I can more easily write measures.

However, I am getting this error when typing require "openstudio."

irb terminal error

edit: I was able to use uru to switch to the correct version of Ruby (2.2.4) for OS 2.9.0.

I faced an additional error thrown because I was using 32-bit Ruby vs 64-bit Ruby, but I was able to correct that by downloading Ruby 2.2.4x64 and switching to that environment using uru.

Now I am facing this error message.

irb terminal error 2

UPDATE: not sure what worked, maybe I forgot to switch to the x64 version of Ruby 2.2.4 (correct Ruby version for E+ v9.2), but I got the OS SDK bindings to work!

OS SDK bindings working

Thanks!

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
4

answered 3 years ago

You should be using Ruby 2.2.4 if you are using OpenStudio 2.9.0, see the OpenStudio SDK Version Compatibility Matrix.

You'll also want to make sure that you're using 32-bit vs 64-bit consistently between the OpenStudio SDK and Ruby, otherwise it can give the above error.

Preview: (hide)
link
0

answered 3 years ago

OpenStudio 2.9 is not compatible with Ruby 2.7.3. Use Ruby 2.7.2 and OS v3.2 instead.

See the compatibility matrix to ensure you are using correct software versions

Preview: (hide)
link

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

1 follower

Stats

Asked: 3 years ago

Seen: 278 times

Last updated: Jul 26 '21