Issue #10558 has been updated by Michal Papis.


it's few libraries, most important here `openssl 1.0.1j`: 

~~~
CFLAGS="-fPIC" LDFLAGS="-fPIC" ./Configure darwin64-x86_64-cc zlib no-shared --openssldir=/etc/openssl --prefix=~/openssl101j
make install -j 1
sed -e '/^Libs:/ s/Libs:/Libs: -lz/' -i ~/openssl101j/lib/pkgconfig/openssl.pc
~~~
and use `~/openssl101j` for the `-I/-L` flags


----------------------------------------
Bug #10558: failing require digest.so on OSX statically compiled ruby
https://bugs.ruby-lang.org/issues/10558#change-50298

* Author: Michal Papis
* Status: Feedback
* Priority: Normal
* Assignee: 
* Category: 
* Target version: current: 2.2.0
* ruby -v: 2.2.0-preview2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
compiling 2.2.0-preview2 and 2.2.0-preview1 with following flags:

`env LDFLAGS=-L/Users/mpapis/.sm/pkg/active/lib -fPIC -Bstatic CFLAGS=-O3 -I/Users/mpapis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 ./configure --prefix=/Users/mpapis/.rvm/rubies/ruby-2.2.0-preview2 --disable-install-doc --enable-load-relative --with-static-linked-ext --with-out-ext=dl/win32,fiddle/win32,tk/tkutil,tk,win32ole,-test-/win32/dln,-test-/win32/fd_setsize --sysconfdir=/etc --disable-install-doc --disable-shared --with-arch=x86_64`

it compiles but files on installation with:

`/Users/travis/.rvm/src/ruby-2.2.0-preview2/.ext/common/digest.rb:1:in `require': cannot load such file -- digest.so (LoadError)` (got the command and error from different machines)

this bug was reported earlier as https://bugs.ruby-lang.org/issues/8721 but now it happens on multiple machines, can not ignore it

this prevents from building a movable OSX ruby binary




-- 
https://bugs.ruby-lang.org/