Open kaiquekandykoga opened 11 months ago
This is odd. libyaml
and libffi
are definitely dependencies for FreeBSD's pkg
util and they appear to be installed. Ruby's ./configure
should be able to find them in /usr/local
.
As mentioned in the linked issue, /usr/local
isn't included in search path by default.
If one has pkgconf
installed, some gems (including psych
and fiddle
) may still be successfully installed when the gem checks for additional flags through it using pkg_config
method from mkmf
. readline
doesn't though so it must have the prefix explicitly specified.
That said, all this thing is generally a minefield so I just set these env when building ruby (not needed when building gems):
export cflags="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
# just setting the two above is probably enough
export cxxflags="${cflags}"
export cppflags="${cflags}"
export LIBS="-L/usr/local/lib"
With the env above any native extensions will have /usr/local
included during build (including readline
) without needing to specify the path manually.
(note that it should probably use $(sysctl -n user.localbase)
instead of hardcoding /usr/local
)
@nanaya I think you should report this upstream to https://bugs.ruby-lang.org/ CRuby should be able to link against libraries in /usr/local
which is a standard FHS directory. I want to avoid patching/working-around CRuby issues that could be fixed upstream.
Description
I think it is related to https://github.com/rbenv/ruby-build/issues/2184.
Steps To Reproduce
Expected Behavior
Install 3.2.2.
Actual Behavior
Environment