RubyGems install errors
If you happen to have an existing bundler at /usr/local/bin/bundle, then pkgx rubygems install fails with:
This seems very wrong because pkgx doesn't even install anything to /usr/local. So having an old bundle binary lying around shouldn't cause rubygems install to fail.
But come to think of it, I've experienced a lot of weird things using pkgx rubies that cause subtle bundle install issues, and I suspect this faulty gem home might be the root of it. Inside a pkgx project when I run gem env it has /usr/local in my gem path:
And it carries through to your bundle env as well:
The value for Gem Home above should be whatever pkgx ruby -e 'puts Gem.user_dir' evaluates to.
Not sure what's happening, but I suspect pkgx rubygems needs to be more tightly coupled to pkgx ruby.
there's a lot of path manipulation being done in the recipes for ruby-lang.org and rubygems.org to try and keep them both isolated and working. if you're a dab hand at ruby, perhaps you can figure out what piece is missing to make it all tick.
Can take a look at it @jhheider. I imagine it's something to do with this comment. Do you know the reason this was needed?
I don't offhand. It's likely darwin-focused, since that's our primary development platform. You could try just adding an if: darwin to that stanza and see if it helps you.
Well @jhheider. I'm on darwin as well, and that's where the install error I posted above is happening. It can be replicated on darwin with:
sudo touch /usr/local/bin/bundle
pkgx install rubygems.org@latest
However, it does only appear to be an issue with pkgx install name@version, not pkgx name@version in case that helps.
One other question. Why the discrepancy between these two ways of calling pkgx without install?
Ah, yeah. The install scripts are a little more fragile. That's possibly something we should move to pkgxdev/pkgx for exploration.
For invocation, gem@latest is a provides:. The latter would need to be pkgx +rubygems.org@latest gem --version. Packages don't have default binaries.