RubyGems and OpenBSD
So today I wanted to get the lovely Pupistry going on OpenBSD. With a bit of ugly hackery (read: a lot of scripted symlink creation) I got it going, and eventually after a lot of Googling and a bit of experimentation, I minimised the ugly hackery to something I'm reasonably non-sad about.
The most annoying obstacle I encountered was that RubyGems wanted to name executables deployed by gems (eg. bin/puppet) with the same pattern as the relevant Ruby executable being used, such as bin/ruby23.
That is, instead of gem install puppet giving you bin/puppet, one gets bin/puppet23 instead, with nary a symlink to make things work as you'd expect.
My Ruby binary is called ruby23 because that's what the OpenBSD ruby-2.3.1p2 package calls it. I didn't want to mess with that, and as it turns out, messing with it (such as a hardlink, a la ln ruby23 ruby) doesn't help anyway.
The solution is to put the below snippet in lib/ruby/2.3/rubygems/defaults/operating_system.rb:
module Gem def self.default_exec_format '%s' end end
The exact path to this file will of course vary by Ruby version, and by operating system. It probably won't exist, and the defaults directory containing it may not exist either.
What is actually happening here is that RubyGems loads this file, if it exists, to set any local defaults. These override defaults.rb, so look in that file to see more detail.
Also you definitely don't want to do this if you install multiple Ruby versions in the same prefix, such as /usr/local in my case.









