WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. FOR MACBOOK m series, m1,m2,m3

 WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile: export LANG=en_US.UTF-8


here is the solution 


1. **Edit Locale Configuration**:

   Open the locale configuration file:


   ```sh

   sudo nano /etc/locale.conf

   ```


   Add the following lines to set the locale:


   ```sh

   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

   ```


   Save and exit the file (Ctrl + O, Enter, Ctrl + X).


2. **Generate Locale**:

   Ensure the `en_US.UTF-8` locale is generated:


   ```sh

   sudo locale-gen en_US.UTF-8

   sudo dpkg-reconfigure locales

   ```


3. **Add Locale to Profile Files**:

   Add the locale settings to your profile files. This ensures they are loaded for your user session.


   For `bash`:


   ```sh

   echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile

   echo 'export LC_ALL=en_US.UTF-8' >> ~/.bash_profile

   ```


   For `zsh`:


   ```sh

   echo 'export LANG=en_US.UTF-8' >> ~/.zshrc

   echo 'export LC_ALL=en_US.UTF-8' >> ~/.zshrc

   ```


   Add to `.profile` as well:


   ```sh

   echo 'export LANG=en_US.UTF-8' >> ~/.profile

   echo 'export LC_ALL=en_US.UTF-8' >> ~/.profile

   ```


4. **Source Profile Files**:

   Source the profile files to apply the changes:


   ```sh

   source ~/.bash_profile

   source ~/.zshrc

   source ~/.profile

   ```


5. **Restart Terminal**:

   Close and reopen your terminal to ensure all changes take effect.


6. **Verify Locale Settings**:

   Open a new terminal session and verify the locale settings:


   ```sh

   locale

   ```


   The output should look like this:


   ```sh

   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"

   ```


7. **Run CocoaPods Command**:

   Try running the CocoaPods command again.


By following these steps, your locale settings should be correctly configured, and the CocoaPods UTF-8 encoding warning should be resolved.


Comments

Popular posts from this blog