Project

General

Profile

Actions

Bug #18876

closed

OpenSSL is not available with `--with-openssl-dir`

Added by Gloomy_meng (Gloomy Meng) about 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:109043]

Description

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:

/usr/bin/perl Configure --prefix="......./local/dependencies" no-shared zlib darwin64-x86_64-cc

then make & make install ruby with this configure:

/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

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:

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

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) bundle-env Gloomy_meng (Gloomy Meng), 06/23/2022 08:51 AM
mkmf.log (215 KB) mkmf.log Gloomy_meng (Gloomy Meng), 06/23/2022 08:57 AM

Updated by alanwu (Alan Wu) about 2 months ago

  • Status changed from Open to Feedback

Since bundle-env ruby -ropenssl works, I suspect it has something to
do with --env-shebang. Maybe the gem command isn't running with
the Ruby you want. Try running RUBYOPT=-v bundle-env gem and
comparing that with ruby -v (without bundle-env). You might
also want to try RUBYOPT=-vd to surface any errors while loading
OpenSSL; it looks like RubyGems loads it using an autoload:
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/openssl.rb

Updated by Gloomy_meng (Gloomy Meng) about 2 months ago

my local version is 3.1.1 too, and run ruby -v , got ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin20].

and i tried some different version with add RUBYOPT=-v and RUBYOPT=-vd to make a comparison.


with 3.1.1 and -vd

[11:26:11] [Gems] destroot/bundle/bin/bundle-env gem install cocoapods --version="1.11.3" --no-document --env-shebang
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21]
Exception `LoadError' at /Users/didi/Documents/CocoaPods-app3.1.1/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-app3.1.1/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-app3.1.1/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant BigDecimal

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `NameError' at /Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant Date

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `NameError' at /Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant DateTime

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().load_tags=
             ^

Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().dump_tags=
             ^

Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().domain_types=
                ^

Exception `Gem::Exception' at /Users/didi/Documents/CocoaPods-app3.1.1/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
ERROR:  While executing gem ... (Gem::Exception)
    OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:47:in `configure_connection_for_https'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/https_pool.rb:6:in `setup_connection'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/http_pool.rb:39:in `make_connection'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/http_pool.rb:20:in `checkout'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:129:in `connection_for'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:188:in `perform_request'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:154:in `fetch'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:309:in `request'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:209:in `fetch_http'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:248:in `fetch_path'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source.rb:95:in `dependency_resolver_set'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:23:in `block in pick_sets'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source_list.rb:98:in `each'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source_list.rb:98:in `each_source'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:22:in `pick_sets'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:28:in `find_all'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/installer_set.rb:175:in `find_all'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/installer_set.rb:61:in `add_always_install'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/dependency_installer.rb:322:in `resolve_dependencies'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:201:in `install_gem'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:226:in `block in install_gems'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `each'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `install_gems'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:167:in `execute'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command.rb:323:in `invoke_with_build_args'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:185:in `process_args'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:149:in `run'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/gem_runner.rb:53:in `run'
	/Users/didi/Documents/CocoaPods-app3.1.1/destroot/bundle/bin/gem:13:in `<main>'

Finished in 12 minutes and 18 seconds

with 3.1.0 and -v

[11:05:45] [Gems] destroot/bundle/bin/bundle-env gem install cocoapods --version="1.11.3" --no-document --env-shebang
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]
ERROR:  While executing gem ... (Gem::Exception)
    OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources

with 3.1.0 and -vd

[11:26:26] [Gems] destroot/bundle/bin/bundle-env gem install cocoapods --version="1.11.3" --no-document --env-shebang
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [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

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant Date

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/psych/class_loader.rb:70 - uninitialized constant DateTime

        [val, ::Object.const_get(val)]
                      ^^^^^^^^^^
Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().load_tags=
             ^

Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().dump_tags=
             ^

Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.1.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
().domain_types=
                ^

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
ERROR:  While executing gem ... (Gem::Exception)
    OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:47:in `configure_connection_for_https'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/https_pool.rb:6:in `setup_connection'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/http_pool.rb:39:in `make_connection'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request/http_pool.rb:20:in `checkout'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:129:in `connection_for'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:188:in `perform_request'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/request.rb:154:in `fetch'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:309:in `request'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:209:in `fetch_http'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/remote_fetcher.rb:248:in `fetch_path'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source.rb:95:in `dependency_resolver_set'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:23:in `block in pick_sets'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source_list.rb:98:in `each'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/source_list.rb:98:in `each_source'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:22:in `pick_sets'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/best_set.rb:28:in `find_all'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/installer_set.rb:175:in `find_all'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/resolver/installer_set.rb:61:in `add_always_install'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/dependency_installer.rb:322:in `resolve_dependencies'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:201:in `install_gem'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:226:in `block in install_gems'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `each'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:219:in `install_gems'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/commands/install_command.rb:167:in `execute'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command.rb:323:in `invoke_with_build_args'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:185:in `process_args'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/command_manager.rb:149:in `run'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/gem_runner.rb:53:in `run'
	/Users/didi/Documents/CocoaPods-app/destroot/bundle/bin/gem:28:in `<main>'

Finished in 2 minutes and 42 seconds

my local version is 3.1.1 too, so i tried with 3.0.3 and 3.1.0 version for your suggestion.


with add RUBYOPT=-v and version is 3.0.3

when run

destroot/bundle/bin/bundle-env gem install downloads/rubygems-update-3.3.15.gem --no-document --env-shebang

i got error with this

ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]
Exception `LoadError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems.rb:1332 - cannot load such file -- rubygems/defaults/ruby
Exception `LoadError' at <internal:/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at <internal:/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:162 - cannot load such file -- rubygems/defaults/operating_system
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/psych/class_loader.rb:70 - uninitialized constant BigDecimal
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/psych/class_loader.rb:70 - uninitialized constant Date
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/psych/class_loader.rb:70 - uninitialized constant DateTime
Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
Exception `SyntaxError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/forwardable/impl.rb:4 - <compiled>: syntax error, unexpected end-of-input
Exception `Gem::MissingSpecError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/dependency.rb:311 - Gem::MissingSpecError
Exception `Gem::MissingSpecError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/specification.rb:1402 - Gem::MissingSpecError
Exception `Gem::MissingSpecError' at <internal:/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:76 - Gem::MissingSpecError
Exception `Gem::MissingSpecError' at <internal:/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:162 - Gem::MissingSpecError
Exception `Gem::MissingSpecError' at <internal:/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:162 - Gem::MissingSpecError
Exception `NameError' at /Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/3.0.0/rubygems/command_manager.rb:225 - uninitialized constant Gem::Commands::InstallCommand
Did you mean?  Gem::InstallUpdateOptions
ERROR:  Loading command: install (Gem::MissingSpecError)

with add RUBYOPT=-v and version is 3.1.0

Updated by Gloomy_meng (Gloomy Meng) about 2 months ago

bundle-env's ruby is new installed , not my local version

Updated by alanwu (Alan Wu) about 1 month ago

  • Status changed from Feedback to Open

I had some issues building OpenSSL
and the Ruby wrapper, but I was able to reproduce this problem.

RubyGems sets an autoload for OpenSSL and then immediately triggers it with a
defined?:

# from lib/rubygems/openssl.rb
autoload :OpenSSL, "openssl"

module Gem
  HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
end

This exposes a behavior particular to the Ruby build configuration. It seems
that defined?(AutoLoadConstant) returns nil as opposed to loading the file
in other build configurations:

$ ruby --disable-all -ve 'autoload(:Ripper, "ripper"); p defined?(Ripper)'
ruby 3.2.0dev (2022-06-26T13:24:22Z static-ext-load-rel 49d5921550) [x86_64-darwin21]
nil
$ chruby 3.1.2
$ ruby --disable-all -ve 'autoload(:Ripper, "ripper"); p defined?(Ripper)'
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
"constant"

I haven't investigated any deeper than this.

As a workaround, you can try applying the following patch against 3.1.2; I'm
able to run gem install rubygems-update with it.

--- a/lib/rubygems/openssl.rb
+++ b/lib/rubygems/openssl.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true

-autoload :OpenSSL, "openssl"
+require "openssl"

 module Gem
   HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:

Updated by Gloomy_meng (Gloomy Meng) about 1 month ago

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.

[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.

Updated by Gloomy_meng (Gloomy Meng) about 1 month ago

and [11:01:21] [rubygems-update-3.3.15] Patching: destroot/bundle/bin/gem is replace #!/Users/didi/Documents/CocoaPods-app/destroot/bundle/bin/ruby by #!/usr/bin/env ruby.

Updated by alanwu (Alan Wu) about 1 month ago

Try the patch I posted on:

/Users/didi/Documents/CocoaPods-app/destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/openssl.rb

After update_rubygems. The update probably reverts the patch against the bundled version.
You can check the contents of that file to make sure it's patched.

Updated by Gloomy_meng (Gloomy Meng) about 1 month ago

i install cocoapods succeed, tks.

so i only need update opessl.rb file in destroot/bundle/lib/ruby/site_ruby/3.1.0/rubygems/ when finished update_rubygems

Actions #9

Updated by hsbt (Hiroshi SHIBATA) about 1 month ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF