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

Revision history [back]

As Kyle mentioned, there is a way to customize the irb startup configuration. You have to do the following:

If ~/.irbrc does not exist, call touch ~/.irbrc to create it.

Then inside ~/.irbrc you can put

// I think this is the correct pathing    
require "/Applications/OpenStudio 1.10.0/Ruby/openstudio.rb"
require 'irb/completion'

or what I have in my ~/.irbrc file (other than different openstudio.rb path for my dev build)

IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:LOAD_MODULES] = [] unless IRB.conf.key?(:LOAD_MODULES)
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
  IRB.conf[:LOAD_MODULES] << 'irb/completion'
end
require "/Applications/OpenStudio 1.10.0/Ruby/openstudio.rb"

This will automatically load completion and openstudio everytime you call irb on command line.

As Kyle mentioned, there is a way to customize the irb startup configuration. You have to do the following:following (assuming Mac or Linux):

If ~/.irbrc does not exist, call touch ~/.irbrc to create it.

Then inside ~/.irbrc you can put

// I think this is the correct pathing    
require "/Applications/OpenStudio 1.10.0/Ruby/openstudio.rb"
require 'irb/completion'

or what I have in my ~/.irbrc file (other than different openstudio.rb path for my dev build)

IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:LOAD_MODULES] = [] unless IRB.conf.key?(:LOAD_MODULES)
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
  IRB.conf[:LOAD_MODULES] << 'irb/completion'
end
require "/Applications/OpenStudio 1.10.0/Ruby/openstudio.rb"

This will automatically load completion and openstudio everytime you call irb on command line.