Closed sandrinr closed 5 years ago
Can you show the result of otool -L /path/to/your/psych.bundle
?
On systems with multiple Homebrew instances
It seems non-commonly environment, I think.
Below you can find the otool
output.
$ otool -L /opt/origammi-toolchain/lamp-apache24-mysql57-php70-es17/homebrew/Cellar/rbenv/1.1.0/versions/2.4.0/lib/ruby/2.4.0/x86_64-darwin15/psych.bundle
/opt/origammi-toolchain/lamp-apache24-mysql57-php70-es17/homebrew/Cellar/rbenv/1.1.0/versions/2.4.0/lib/ruby/2.4.0/x86_64-darwin15/psych.bundle:
/usr/local/opt/libyaml/lib/libyaml-0.2.dylib (compatibility version 3.0.0, current version 3.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
Here my expectation would be that otool
would show the libyaml dependency to /opt/origammi-toolchain/lamp-apache24-mysql57-php70-es17/homebrew/opt/libyaml/lib/libyaml-0.2.dylib
instead of the one in the default Homebrew location.
We use Homebrew to generate switchable web development toolchains which is not a "standard" application of Homebrew for sure. But a handy one :-).
My point is that ruby-build
seems to have all the necessities in place but just does not use them for recent Ruby versions.
My preliminary analysis showed that ruby-build would have the infrastructure to do this the right way (i.e. use the
--with-libyaml-dir
configure option), contained in the functionuse_homebrew_yaml
. However, it seems that this function is not used when compiling more recent versions of Ruby.
Correct (re: last point). To solve your libyaml issues, you should use RUBY_CONFIGURE_OPTS=--with-libyaml-dir=...
explicitly.
On systems with multiple Homebrew instances, ruby-build will only use the libyaml installation in the default Homebrew installation location.
Steps to reproduce:
libyaml
is installedlibyaml
,libffi
,rbenv
, andruby-build
are available in this Homebrew instance.PATH
in your current shell is set such that thebin
directory of the second Homebrew instance is first on yourPATH
libyaml
(you will have to do that in another shell to ensure you are calling the correctbrew
)irb
of your installed Ruby version above runrequire "yaml"
libyaml
library although it is installed in the Homebrew instance which contains the ruby-build version which built this version of RubyMy preliminary analysis showed that ruby-build would have the infrastructure to do this the right way (i.e. use the
--with-libyaml-dir
configure option), contained in the functionuse_homebrew_yaml
. However, it seems that this function is not used when compiling more recent versions of Ruby.