[scaffolding-ruby] Process bins not working when installed from a .hart


#1

Up until recently I’ve been doing hab docker export of my hart files to create a docker image of my ruby application for deployment. Once deployed, a number of process-bin files (my_app-rake, my_app-console, etc) were created, added to the path, and consistently worked as expected. Those tools became cornerstones of our processes for running one-off tasks with rake, or debugging with the console.

However, I’ve recently had to switch up my packaging strategy and am now using a dockerfile which installs my .hart as one of it’s steps in order to create my docker image. This has worked well, until I needed to run rake today. The process stubs are no longer added to the path, and if I dig them up and try to run them I get:

./my_app-rake: exec: line 19: bundle: not found

Which tells me there’s environmental stuff that needs to be set, but is missing. Sourcing app_env.sh is no help, and I wouldn’t expect it to be after looking at the contents. I’ve found though that I can make them fly with:

hab pkg exec my_origin/my_app my_app-rake

Is this expected behavior? It basically works, but there’s gotchas (https://github.com/habitat-sh/habitat/issues/5510) and the inconsistency is confusing.


#2

My guess would be that the docker export is binlinking bundle during export. If manually binlinking core/ruby and core/bundler fixes your issue, you could probably just add that to your Dockerfile.


#3

@HT154 that was my first thought too.

I’m curious as to how ruby/bundler is being invoked. e.g.: is the package being built against /hab/pkgs/core/ruby or possibly a “system” ruby? I’m wondering would a fix_interpreter on bundler help at all?

(possibly another use case where #4493 would help?)


#4

That would possibly address part of the problem, and I’ll certainly look into that. What about the process-bins being missing from the path?