Set up the Ruby environment with RVM or rbenv in Mac
Hello, I'm new to Ruby and OpenStudio measure development. I have a question upon how to set up the environment of OpenStudio library for Ruby in Mac.
Currently I'm running Ruby through rvm(Ruby Version Manager) which is a stand alone ruby directory so that I won't mess up with the System Ruby. Here's what I did:
First I ran gem install openstudio
to get the library installed.
After that I ran require "openstudio"
in the IRB, the error message prints:
LoadError: cannot load such file -- openstudioutilitiescore
My ruby version in the rvm is 2.0.0p643 and OpenStudio v. 1.7.5.
Any help would be appreciated!
-----------------------------------------------------------------------------------------------------------------------------------------------------
Thanks David.
Here is what I did after:
I created the openstudio.rb file with the content:
require '/Applications/OpenStudio 1.7.5/Ruby/openstudio.rb'
And then saved it to:
/Users/my_user_name/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/
Then I uninstalled the openstudio package (which I install with gem earlier)
I tried to run require "openstudio"
again in the irb.
The reports prints:
-- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following: * ~/Library/Logs/CrashReporter * /Library/Logs/CrashReporter * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports the more detail of.
-- Control frame information ----------------------------------------------- c:0027 p:-17572663487022 s:0124 e:000123 TOP [FINISH] c:0026 p:---- s:0122 e:000121 CFUNC :require c:0025 p:0113 s:0118 e:000117 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/siteruby/2.0.0/rubygems/coreext/kernelrequire.rb:54 c:0024 p:0476 s:0108 e:000107 TOP /Applications/OpenStudio 1.7.5/Ruby/openstudio.rb:86 [FINISH] c:0023 p:---- s:0102 e:000101 CFUNC :require c:0022 p:0113 s:0098 e:000097 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/siteruby/2.0.0/rubygems/coreext/kernelrequire.rb:54 c:0021 p:0007 s:0088 e:000087 TOP /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/siteruby/openstudio.rb:1 [FINISH] c:0020 p:---- s:0086 e:000085 CFUNC :require c:0019 p:0113 s:0082 e:000081 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/siteruby/2.0.0/rubygems/coreext/kernelrequire.rb:54 c:0018 p:0007 s:0072 e:000071 EVAL (irb):1 [FINISH] c:0017 p:---- s:0070 e:000069 CFUNC :eval c:0016 p:0024 s:0063 e:000062 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/irb/workspace.rb:86 c:0015 p:0025 s:0056 e:000054 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/irb/context.rb:380 c:0014 p:0022 s:0050 e:000049 BLOCK /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/irb.rb:492 c:0013 p:0040 s:0042 e:000041 METHOD /Users/YJ/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/irb.rb:624 c:0012 p:0009 s:0037 e:000036 BLOCK /Users ...