First time here? Check out the Help page!

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

openstudio-standards gem path problem

asked 9 years ago

updated 9 years ago

I've built and installed the openstudio-standards gem, but although OpenStudio can find the measure, I get the following error when trying to apply it.

    dyld: warning, LC_RPATH @executable_path/../lib in /Applications/OpenStudio 1.10.0/Ruby/openstudio/openstudiosdd.bundle being ignored in restricted program because of @executable_path
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- openstudio-standards (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /private/var/folders/gs/9ltb1x5s3xd69zyybll7sjnh0000gn/T/OpenStudio.V30370/ApplyMeasureNow/UserScript/user_script.rb:5:in `<class:CreateDOEPrototypeBuilding>'
    from /private/var/folders/gs/9ltb1x5s3xd69zyybll7sjnh0000gn/T/OpenStudio.V30370/ApplyMeasureNow/UserScript/user_script.rb:3:in `<top (required)>'
    from in.rb:103:in `load'
    from in.rb:103:in `<main>'
Script executing from: /private/var/folders/gs/9ltb1x5s3xd69zyybll7sjnh0000gn/T/OpenStudio.V30370/ApplyMeasureNow/UserScript
Found argument 'building_type' with value 'SmallOffice'.
Found argument 'template' with value '90.1-2010'.
Found argument 'climate_zone' with value 'ASHRAE 169-2006-2A'.

Does anyone either recognize the problem or know how to debug this from within OpenStudio? E.g., how can I tell where OpenStudio is looking for gems and what path I am missing in my PATH variable?

Preview: (hide)

Comments

Alternatively, is it possible to run the measure as a non-gem?

__AmirRoth__'s avatar __AmirRoth__  ( 9 years ago )

2 Answers

Sort by » oldest newest most voted
5

answered 9 years ago

long's avatar

updated 9 years ago

It looks like OpenStudio is using system Ruby (not sure why). Try this.

In your openstudio-standards checkout and build the ruby gem:

cd <path-to-openstudio-standards-root>/openstudio-standards
bundle
rake build

Then use system ruby to install the gem:

sudo /usr/bin/gem install <path-to-openstudio-standards-root>/openstudio-standards/openstudio-standards-0.1.0.gem

I did try using --user-install option to avoid sudo, but for some reason that didn't work.

In OpenStudio run "Apply Measure Now" and it just worked.

Preview: (hide)
link

Comments

If you use the user install you need to set GEM_PATH to the location where the gem was installed locally. It is weird that Ruby doesn't automatically do this for you but it doesn't.

macumber's avatar macumber  ( 9 years ago )

Nick, you are the man. As you know I was tripped up by this last week as well. Your workaround here worked a treat for me.

rpg777's avatar rpg777  ( 9 years ago )

@macumber, I did add GEM_PATH when I first hit this (GEM_PATH=/Users/rgugliel/.gem/ruby/2.0.0), but still no go until I tried Nick's advice here.

rpg777's avatar rpg777  ( 9 years ago )

Hmm, well installing the gem to a particular Ruby install will only install the gem to that instance of Ruby. The user directory solution is preferred because it would work across multiple versions of Ruby (e.g. system and OS version). Sounds like the steps need to be tweaked for Macs, I've only tested on Windows.

macumber's avatar macumber  ( 9 years ago )

Thanks, Ruby-Wan Kenobi!

__AmirRoth__'s avatar __AmirRoth__  ( 9 years ago )
2

answered 9 years ago

I was waiting for @aparker to comment but I believe this is the prefered way to install the standards gem. Basically you install it in a user location and then set GEM_PATH (which is separate from RUBY_PATH) to this location. The gem will be loaded from your user location before any other location:

  1. Check out https://github.com/NREL/openstudio-st...
  2. cd \openstudio-standards\openstudio-standards
  3. bundle install
  4. rake build
  5. gem install --user-install pkg/openstudio-standards-0.1.0.gem
  6. Set environment variable GEM_PATH to the user gem directory, e.g. C:\Users\dmacumbe.gem\ruby\2.0.0
Preview: (hide)
link

Comments

1

Step 6 is the step in question. That doesn't work for me and I haven't looked into exactly why yet. Granted I have 5 versions of Ruby on my machine.

long's avatar long  ( 9 years ago )

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

3 followers

Stats

Asked: 9 years ago

Seen: 750 times

Last updated: Jan 19 '16