首先要安装好openssl openssl官网下载openssl,解压包,然后编译
./config shared --prefix=/usr -fPIC
make
make install
下载rub源码包,解压
cd ext/openssl
ruby extconf.rb
make
make install
可能遇到的问题: thread_native.h找不到 需要在Makefile中加一行
$(OBJS): $(HDRS) $(ruby_headers) \
$(hdrdir)/ruby/io.h \
$(hdrdir)/ruby/encoding.h \
$(hdrdir)/ruby/oniguruma.h \
$(hdrdir)/ruby/thread.h
**top_srcdir=../../**
ossl.o: $(top_srcdir)/thread_native.h $(top_srcdir)/thread_$(THREAD_MODEL).h