Bug 249083 - devel/ruby-gems fails to install if /usr/local is a symlink
Summary: devel/ruby-gems fails to install if /usr/local is a symlink
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-03 17:30 UTC by Eric W.Bates
Modified: 2020-09-03 17:49 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric W.Bates 2020-09-03 17:30:46 UTC
If one has moved /usr/local to a separate file system and symlink'ed it to it's original location (e.g.: /usr/ports - > /u1/usr-local ), then during install the commands:

/bin/mkdir -p /usr/ports/devel/ruby-gems/work/stage/usr/local/lib/ruby/gems/2.6
cd /usr/ports/devel/ruby-gems/work/rubygems-3.0.6/ && /usr/bin/env DONT_USE_BUNDLER_FOR_GEMDEPS=true G
EM_HOME=/usr/ports/devel/ruby-gems/work/stage/usr/local/lib/ruby/gems/2.6 /usr/local/bin/ruby26 setup.
rb --destdir=/usr/ports/devel/ruby-gems/work/stage --no-regenerate-binstubs --no-ri --no-rdoc

causes the creation of two trees in ./stage:

./stage/u1/usr-local/bin/gem26
./stage/usr/local... [everything else]

Only the script gem26 appears in the path ./u1/usr-local/.., but that's sufficient for the install to fail with:

pkg-static: Unable to access file /usr/ports/devel/ruby-gems/work/stage/usr/local/bin/gem26:No such fi
le or directory

My work-around was to "make" "mv u1/usr-local/bin/gem26 usr/local/bin/" "make install"

I believe this is a bug in the ruby script 'setup,' but I have never learned ruby.