How to tell which openssl lib is actually being used by an RVM-installed ruby

前端 未结 2 1768
有刺的猬
有刺的猬 2021-01-05 05:46

I discovered that I can successfully install ruby with any of the following commands:

$ rvm reinstall 1.9.3-p327
$ rvm reinstall 1.9.3-p327 --with-openssl-di         


        
相关标签:
2条回答
  • 2021-01-05 06:16

    How about:

    ruby -ropenssl -e "puts OpenSSL::VERSION"
    
    0 讨论(0)
  • 2021-01-05 06:32

    Ruby has quite complicated mechanisms for detecting libraries, every extension has it's own code for that. Fortunately most of the extensions support pkg-config so it's possible to force location of *.pc files:

    PKG_CONFIG_PATH=/path/to/openssl/lib/pkgconfig rvm reinstall 1.9.3
    rvm use 1.9.3
    

    then after compilation you can verify on OSX:

    find $MY_RUBY_HOME -name openssl.bundle | xargs otool -L
    

    or on linux:

    find $MY_RUBY_HOME -name openssl.so | xargs ldd
    

    as for the --with-openssl-dir=... it is not fully supported by ruby, it should be --with-opt-dir=... + --with-openssl, opt-dir supports multiple paths separated with : starting from ruby 1.9.3-p327

    0 讨论(0)
提交回复
热议问题