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

Ruby bindings in OpenStudio SDK error

asked 2021-06-22 12:43:15 -0500

sashadf1 gravatar image

updated 2021-07-26 14:26:33 -0500

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!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2021-06-22 12:56:40 -0500

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.

edit flag offensive delete link more
0

answered 2021-06-22 12:54:02 -0500

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

edit flag offensive delete link more

Your Answer

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

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2021-06-22 12:43:15 -0500

Seen: 72 times

Last updated: Jul 26