Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode Normalization not appropriate for ASCII-8BIT #11891

Closed
MuhammedRefaat opened this issue May 5, 2023 · 4 comments
Closed

Unicode Normalization not appropriate for ASCII-8BIT #11891

MuhammedRefaat opened this issue May 5, 2023 · 4 comments

Comments

@MuhammedRefaat
Copy link

I've an issue when running pod install among app build

What did you do?

I just did run the app which by turn shall run pod install

What did you expect to happen?

expecting it to run successfully specially that it works fine when running pod install individually

What happened instead?

instead I'm getting this error:

Error output from CocoaPods:
↳
        WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
        Consider adding the following to ~/.profile:

        export LANG=en_US.UTF-8
        
    /usr/local/Cellar/ruby/3.2.2/lib/ruby/3.2.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:166:in `unicode_normalize'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:166:in `installation_root'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:226:in `podfile_path'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface/error_report.rb:30:in `report'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:66:in `report_error'
        from /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
        from /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
        from /usr/local/bin/pod:25:in `load'
        from /usr/local/bin/pod:25:in `<main>'
    /usr/local/Cellar/ruby/3.2.2/lib/ruby/3.2.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:166:in `unicode_normalize'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:166:in `installation_root'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:226:in `podfile_path'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:205:in `podfile'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:46:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
        from /usr/local/bin/pod:25:in `load'
        from /usr/local/bin/pod:25:in `<main>'

CocoaPods Environment

ruby: 3.2.0
cocoapods: 1.12.1

Worth to mention that:

  • I have source 'https://cdn.cocoapods.org/' added to my podfile
  • I can run pod install with no issues at all
  • I'm getting the correct unicode when running locale
  • I've the correct unicode added to my ~/.profile & ~/.zshrc
  • which ruby command points to /usr/local/opt/ruby/bin/ruby which sounds good
  • I've reinstalled cocoapods completely but no luck.
  • When running locale:
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

And when just running pod install it works perfectly.

@swapnilsinha17
Copy link

swapnilsinha17 commented Jul 10, 2023

Not works for me i tried this solution

@MuhammedRefaat Please help

@coderDeven
Copy link

I got same error , changed ~/.profile and ~/.zshrc does not works . Did you figure it out ?

@MuhammedRefaat
Copy link
Author

@expertdev-designer @coderDeven
You can check my SO answer here

Finally I found a solution to my issue, only through this link, as it says:

Unfortunately this solution is not obvious for users (myself included) since the common advice for setting macOS Environment Variables in general (including these Cocoapods ones) is to define them in any of .zprofile, .zshrc or .profile files: None of these are respected by Xcode when launching its own 'Run Script' phases.

The variables must be set in the environment in which Xcode itself runs; as user-global environment variables. This is a 'volatile' procedure in macOS, having changed across recent versions. In Monterey it can be achieved with a launchctl task that can be run immediately and registered to run automatically on every reboot.

@coderDeven
Copy link

@expertdev-designer @coderDeven You can check my SO answer here

Finally I found a solution to my issue, only through this link, as it says:
Unfortunately this solution is not obvious for users (myself included) since the common advice for setting macOS Environment Variables in general (including these Cocoapods ones) is to define them in any of .zprofile, .zshrc or .profile files: None of these are respected by Xcode when launching its own 'Run Script' phases.
The variables must be set in the environment in which Xcode itself runs; as user-global environment variables. This is a 'volatile' procedure in macOS, having changed across recent versions. In Monterey it can be achieved with a launchctl task that can be run immediately and registered to run automatically on every reboot.

Thanks !
I found a solution. It‘s works for me . Add three lins below to three files : ~/.zshrc ; ~/.profile ; ~/.bash_profile
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants