0

LoadError: irb require 'openstudio'

Hello,

I am trying to use the OpenStudio SDK with Interactive Ruby (IRB) through cmd, but I get this error. Do you have any advice on how to solve this? Should I be using the correct version of Ruby? I made sure I installed both Ruby and OpenStudio(x64).

irb(main):003:0> require 'openstudio'
<internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- C:openstudio-3.4.0Rubyopenstudio.rb (LoadError)
        from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Ruby31-x64/lib/ruby/site_ruby/openstudio.rb:1:in `<top (required)>'
        from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from (irb):3:in `<main>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
        from C:/Ruby31-x64/bin/irb:33:in `load'
        from C:/Ruby31-x64/bin/irb:33:in `<main>'
irb(main):004:0>
krkh-1702's avatar
45
krkh-1702
asked 2023-02-04 12:30:08 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2023-02-05 14:52:02 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

You need to make it so openstudio.rb is in your Ruby search path. There are several ways to do this. You can set the RUBYLIB environment variable to include the path you the openstudio.rb you want to include. I personally write a file named openstudio.rb to my Ruby installation's lib\ruby\site_ruby directory which loads the openstudio.rb I want from an absolute path. For example, I have the file C:\Ruby27-x64\lib\ruby\site_ruby\openstudio.rb which has as content:

require 'C:\openstudioapplication-1.5.0\Ruby\openstudio.rb'
macumber's avatar
12k
macumber
answered 2023-02-05 17:21:12 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments