OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
This popped up again yesterday when @wenyikuang and @DavidGoldwasser tried to upgrade rubocop to > 1.31.
Rubocop 1.31 added json, ~> 2.3 as a dependency, and that is a native extension. We do have a json 2.6.3 in the CLI, but it would still fails because
Source locally installed gems is ignoring #<Bundler::StubSpecification name=json version=2.7.2 platform=ruby> because it is missing extensions
terminate called after throwing an instance of 'RubyException'
what(): Bundler::GemNotFound: Could not find json-2.7.2 in locally installed gems
Issue overview
This is exactly the same issue as https://github.com/NREL/OpenStudio/issues/5091 which was specifically for
racc
.This popped up again yesterday when @wenyikuang and @DavidGoldwasser tried to upgrade rubocop to > 1.31.
Rubocop 1.31 added
json, ~> 2.3
as a dependency, and that is a native extension. We do have a json 2.6.3 in the CLI, but it would still fails becauseCurrent Behavior
Expected Behavior
Steps to Reproduce
checkout https://github.com/NREL/openstudio-ee-gem/pull/52/commits/e0f9fdc4877cd8868164a710fdffb61ab2f045a4
using system ruby 3.2.2 with bundler 2.4.10
Example command would be
bundle exec rake openstudio:test_with_openstudio
.Or directly and more succinctly
Possible Solution
We should just use the embedded native gems when they are both:
eg rubocop requires json ~> 2.3
bundle _2.4.10_ install --path=$(pwd)/.bundle
would resolve it as json-2.7.2.But our CLI embeds json 2.6.3, which is compatible.
So we should just use the CLI one.
@kbenne FYI.
Details
Environment
Some additional details about your environment for this issue (if relevant):
Context