Bash: move local gem handling to a component.