At the 2016 Chef Community Summit, I attended the “Air-Gapped Environments” session. Although I do not work in an air-gapped environment, our environment has a couple of similar restrictions:
- No internet access
- No compilers
Our solution was to build an omnibus ruby, installing all the gems on a build server that does have compilers. Therefore when the package was installed the binary gem, mysql2, is already installed.
“Cool idea!” was one response. “How’d you do that?” was another. In the true spirit of open spaces, my response was to suggest that they propose an “Omnibus” open space the following day.
The next day during the “Omnibus” open space, I was again describing our approach. People thought it was a clever solution.
“So how do you keep all the gem dependencies up-to-date?”
“I don’t” was my response. “I check in a Gemfile and let bundler handle all that for me.”
There was one mind blown gesture.
When I first coded it, I thought that solution was obvious but perhaps not.
config/Gemfile I pin the specific version of gems that are
The only thing I have in
config/projects/ruby.rb is fairly straight forward:
I am pulling in
omnibus-software in my project’s
Gemfile to get the definitions for
As you can see, with very little code, we can build an omnibus ruby package containing all of the gems required.