First time here? Check our help page!
1

Ruby bindings in OpenStudio SDK error

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!

sashadf1's avatar
1.1k
sashadf1
asked 2021-06-22 12:43:15 -0500, updated 2021-07-26 14:26:33 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

4

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.

shorowit's avatar
11.8k
shorowit
answered 2021-06-22 12:56:40 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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

mdahlhausen's avatar
9.5k
mdahlhausen
answered 2021-06-22 12:54:02 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments