问题
Using brew I go though the normal install process to get rbenv and Ruby installed. Everything goes smoothly but it is soon apparent Ruby did not install with openssl onboard.
The only thing that seems to allow rbenv to auto install openssl during the ruby install is to use this:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include
Is this a bug in rbenv or brew that needs fixing?
回答1:
There's a long thread about rbenv
with openssl on Github here
The easiest way to fix it are:
1) Update to the latest version of rbenv
where they fixed the CONFIGURE_OPTS
options, then delete and re-build all your ruby versions.
2) Use the older version of rbenv and explictly set the CONFIGURE_OPTS to use the brew openssl:
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install <whatever version you need>
来源:https://stackoverflow.com/questions/26639691/ruby-openssl-install-on-mac-10-10-yosemite