From: "Gloomy_meng (Gloomy Meng)" Date: 2022-06-27T03:17:55+00:00 Subject: [ruby-core:109059] [Ruby master Bug#18876] OpenSSL is not available with `--with-openssl-dir` Issue #18876 has been updated by Gloomy_meng (Gloomy Meng). ruby version changed to 3.1.2 still error ~ Here is the file I refer to, https://github.com/CocoaPods/CocoaPods-app/blob/master/Rakefile. --- here is my rake file, step by step execution command. ``` shell [10:47:51] [pkg-config-0.28] /usr/bin/tar -zxvf downloads/pkg-config-0.28.tar.gz -C workbench [10:47:51] [pkg-config-0.28] cd workbench/pkg-config-0.28 && /bin/sh configure --prefix /Users/didi/Documents/CocoaPods-app/destroot/dependencies --enable-static --with-internal-glib [10:48:59] [pkg-config-0.28] cd workbench/pkg-config-0.28 && /usr/bin/make -j 7 [10:49:04] [pkg-config-0.28] cd workbench/pkg-config-0.28 && /usr/bin/make install [10:49:05] [yaml-0.1.6] /usr/bin/tar -zxvf downloads/yaml-0.1.6.tar.gz -C workbench [10:49:05] [yaml-0.1.6] cd workbench/yaml-0.1.6 && /bin/sh configure --prefix /Users/didi/Documents/CocoaPods-app/destroot/dependencies --disable-shared [10:49:14] [yaml-0.1.6] cd workbench/yaml-0.1.6 && /usr/bin/make -j 7 [10:49:15] [yaml-0.1.6] cd workbench/yaml-0.1.6 && /usr/bin/make install [10:49:15] [zlib-1.2.8] /usr/bin/tar -zxvf downloads/zlib-1.2.8.tar.gz -C workbench [10:49:15] [zlib-1.2.8] cd workbench/zlib-1.2.8 && /bin/sh configure --prefix /Users/didi/Documents/CocoaPods-app/destroot/dependencies --static [10:49:16] [zlib-1.2.8] cd workbench/zlib-1.2.8 && /usr/bin/make -j 7 [10:49:17] [zlib-1.2.8] cd workbench/zlib-1.2.8 && /usr/bin/make install [10:49:17] [openssl-1.1.1i] /usr/bin/tar -zxvf downloads/openssl-1.1.1i.tar.gz -C workbench [10:49:18] [openssl-1.1.1i] cd workbench/openssl-1.1.1i && /usr/bin/perl Configure --prefix="/Users/didi/Documents/CocoaPods-app/destroot/dependencies" no-shared zlib darwin64-x86_64-cc [10:49:21] [openssl-1.1.1i] cd workbench/openssl-1.1.1i && /usr/bin/make -j 1 [10:53:23] [openssl-1.1.1i] Patching: workbench/openssl-1.1.1i/libcrypto.pc [10:53:23] [openssl-1.1.1i] Patching: workbench/openssl-1.1.1i/libssl.pc [10:53:23] [openssl-1.1.1i] cd workbench/openssl-1.1.1i && /usr/bin/make install [10:55:18] [ruby-3.1.2] /usr/bin/tar -zxvf downloads/ruby-3.1.2.tar.gz -C workbench [10:55:22] [ruby-3.1.2] cd workbench/ruby-3.1.2 && /bin/sh configure --prefix /Users/didi/Documents/CocoaPods-app/destroot/bundle --enable-load-relative --disable-shared --with-static-linked-ext --disable-install-doc --with-out-ext=",win32,win32/resolv,dbm,gdbm,sdbm,dl/win32,fiddle/win32,tk/tkutil,tk,win32ole,-test-/win32/dln,-test-/win32/fd_setsize,-test-/win32/dln/empty" [10:57:34] [ruby-3.1.2] cd workbench/ruby-3.1.2 && /usr/bin/make -j 7 [11:00:44] [ruby-3.1.2] cd workbench/ruby-3.1.2 && /usr/bin/make install [11:01:11] [bundle-env] Installing [11:01:11] [rubygems-update-3.3.15] destroot/bundle/bin/bundle-env gem install downloads/rubygems-update-3.3.15.gem --no-document --env-shebang [11:01:13] [rubygems-update-3.3.15] destroot/bundle/bin/bundle-env update_rubygems [11:01:21] [rubygems-update-3.3.15] Patching: destroot/bundle/bin/gem [11:01:21] [Gems] destroot/bundle/bin/bundle-env gem install cocoapods --version="1.11.3" --no-document --env-shebang ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21] Exception `LoadError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems.rb:1323 - cannot load such file -- rubygems/defaults/operating_system Exception `LoadError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems.rb:1339 - cannot load such file -- rubygems/defaults/ruby Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant BigDecimal Exception `Gem::Exception' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:47 - OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources ``` ----- and `[openssl-1.1.1i] Patching: workbench/openssl-1.1.1i/libcrypto.pc` is replace `Libs: -L${libdir} -lcrypto` by `Libs: -lz -L${libdir} -lcrypto` here is note in https://github.com/CocoaPods/CocoaPods-app/blob/master/Rakefile in line 423 ``` # Seems to be a OpenSSL bug in the pkg-config, as libz is required when # linking libssl, otherwise Ruby's openssl ext will fail to configure. # So add it ourselves. ``` ----- and `[11:01:21] [rubygems-update-3.3.15] Patching: destroot/bundle/bin/gem` is replace `` by `#!/usr/bin/env ruby`. here is note in https://github.com/CocoaPods/CocoaPods-app/blob/master/Rakefile in line 566 ``` Fix shebang of `gem` bin to use bundled Ruby. ``` ---------------------------------------- Bug #18876: OpenSSL is not available with `--with-openssl-dir` https://bugs.ruby-lang.org/issues/18876#change-98205 * Author: Gloomy_meng (Gloomy Meng) * Status: Open * Priority: Normal * ruby -v: 3.1.1 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- i try use ruby + gem in my macos app with .a framework, i need install ruby in a custom location. so i make & make install openssl with this configure: ``` shell /usr/bin/perl Configure --prefix="......./local/dependencies" no-shared zlib darwin64-x86_64-cc ``` then make & make install ruby with this configure: ``` shell /bin/sh configure --prefix /Users/xxxxx/xxxx/local/bundle --with-openssl-dir="/Users/xxxxx/xxxx/local/dependencies" --enable-load-relative --with-static-linked-ext --disable-install-doc --with-out-ext="xxxxxx" ``` ------ because i need to isolated environment, so i make `bundle-env` file for run shell. and i uploaded bundle-env file ------ and update gem by local ``` shell destroot/bundle/bin/bundle-env gem install downloads/rubygems-update-3.3.15.gem --no-document --env-shebang ``` at last, run install alway got exception: ``` shell destroot/bundle/bin/bundle-env gem install xxxxxxx --version="xxxxxx" --no-document --env-shebang ERROR: While executing gem ... (Gem::Exception) OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources ``` at the same env, i tried some command, and i got the right version what i make install ``` shell destroot/bundle/bin/bundle-env ruby --version // ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21] destroot/bundle/bin/bundle-env gem --version // 3.3.15 destroot/bundle/bin/bundle-env ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' // OpenSSL 1.1.1i 8 Dec 2020 ``` ------ i found and uploaded `ext/openssl/mkmf.log` and ---Files-------------------------------- bundle-env (852 Bytes) mkmf.log (215 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: