loading an external gem in a measure [closed]
I'm trying to solve a problem that has occurred when updating to version 2.1 of OpenStudio. I did not have this problem in the 1.11.x versions of OpenStudio. I'm sure that it is an issue with how my Ruby environment is set up. I am running on a *nix enviroment (in this case, Mac).
The actual gem I am trying to use is the mongo gem, so in my ruby measure I have a simple require statement at the top require 'mongo'
When I load the measure in OpenStudio, the measure shows the red broken scroll, and the message 'cannot load such file -- mongo'
I use RVM to manage my ruby environment. I've double checked to ensure that both gem folders under ~/.rvm for both ruby versions on my machine (2.0.0 and 2.2.0), to ensure there is a mongo folder in there. But, regardless, even if I reboot my machine, restart OpenStudio, I still see the same message and same broken red scroll.
Are there any tricks to try and solve this, e.g. - rvm pristine
or a different way to configure ~/.bashrc ?
Someone mentioned checking my GEM_PATH. I've tried updating my GEM_PATH on my mac to the local gem folders on the machine. Everywhere and anywhere that I've installed the mongo gem, I've referenced it in GEM_PATH. But still getting the broken red scroll.
What is even MORE odd, is that I have other measures with the same
require 'mongo'
command and it seems to be loading fine. So what could be the underlying reason why this is happening?This is true until I edit the measure, and save it. When I save it, now I am getting the same broken scroll. Very odd behavior.