flexn-io/renative

iOS initial run results in build install pod install error caused by uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

Opened this issue · 6 comments

Describe the bug
Initial npx rnv run -p ios on a brand new project results in a error from bundle exec pod install. This prevents moving forward with the installation and running the app on iOS.

To Reproduce
Steps to reproduce the behavior:

  1. Create new project with command npx rnv new.
  • Be sure to select ios for "What platforms would you like to use?"
  • Install all dependencies.
  1. cd into new project.
  2. Run npx rnv run -p ios to begin building the app for the iOS.

Expected behavior
iOS is built and Simulator is opened.

Screenshots or copy&paste

info: Podfile.lock does not exist. Will execute pod actions...
✔ Executing: bundle install
✖ FAILED: bundle exec pod install
error: ⨯ ○ configure: COMMAND:

bundle exec pod install

FAILED with ERROR:

/usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in '<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
 Logger::Severity.constants.each do |severity|
 ^^^^^^
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in '<module:ActiveSupport>'
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/bundler-2.6.2/exe/bundle:20:in '<top (required)>'
	from /usr/local/opt/ruby/bin/bundle:25:in 'Kernel#load'
	from /usr/local/opt/ruby/bin/bundle:25:in '<main>'

Error: Command failed with exit code 1: bundle exec pod install
bundler: failed to load command: pod (/usr/local/lib/ruby/gems/3.4.0/bin/pod)
/usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in '<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

    Logger::Severity.constants.each do |severity|
    ^^^^^^
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in '<module:ActiveSupport>'
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger_silence.rb:5:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support/logger.rb:3:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/lib/ruby/gems/3.4.0/gems/activesupport-7.0.8.7/lib/active_support.rb:29:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/lib/ruby/gems/3.4.0/gems/cocoapods-1.14.3/lib/cocoapods.rb:7:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/lib/ruby/gems/3.4.0/gems/cocoapods-1.14.3/bin/pod:36:in '<top (required)>'
	from /usr/local/lib/ruby/gems/3.4.0/bin/pod:25:in 'Kernel#load'
	from /usr/local/lib/ruby/gems/3.4.0/bin/pod:25:in '<top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Kernel.load'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli.rb:452:in 'Bundler::CLI#exec'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor.rb:538:in 'Bundler::Thor.dispatch'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/cli.rb:29:in 'Bundler::CLI.start'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/bundler-2.6.2/exe/bundle:28:in 'block in <top (required)>'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
	from /usr/local/Cellar/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/bundler-2.6.2/exe/bundle:20:in '<top (required)>'
	from /usr/local/opt/ruby/bin/bundle:25:in 'Kernel#load'
	from /usr/local/opt/ruby/bin/bundle:25:in '<main>'

Desktop (please complete the following information):

  • OS: OSX 14.5
  • Node Version v22.13.1
  • RNV Version 1.9.0 and NRV Version 1.10.0-rc.0
  • Ruby Version 3.4.1
  • Cocoapods Version 1.14.3
  • Template: @rnv/template-starter

Additional context
The problem seems to be the difference between concurrent-ruby v1.3.5 and v1.3.4.

Current Workaround
Adding the following to the Gemfile. Note that, while this issue shows Logger being the issue, adding the logger gem, then shows the same issue for benchmark, bigdecimal and mutex_m.

gem 'concurrent-ruby', '1.3.4'

gem 'logger'
gem 'benchmark'
gem 'bigdecimal'
gem 'mutex_m'

@GCheung55 thanks for reporting. Identical issue is here #1848. If this is solved please close issue

I reinstalled Ruby and Cocoapods, but that didn't work for me.

Add this to the Gemfile:

gem 'concurrent-ruby', '1.3.4'

Solution taken from here

Add this to the Gemfile:

gem 'concurrent-ruby', '1.3.4'

Solution taken from here

Yes, that’s the workaround I described, along with other missing gems, in the original post.

Here's my final Gemfile that works perfectly :

source 'https://rubygems.org'

ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
gem 'concurrent-ruby', '1.3.4'

Here's my final Gemfile that works perfectly :

source 'https://rubygems.org'

ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
gem 'concurrent-ruby', '1.3.4'

Worked for me