Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Xcode for CocoaPods plugin

I am trying to setup terminal/Xcode to work correctly for the Xcode CocoaPods Plugin.

When I run integrate cocoapods option from the plugin I get a message:

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. See https://github.com/CocoaPods/guides.cocoapods.org/issues/26 for possible solutions.[0m

I have searched for the answer to this but I cannot find it. The resolution appears to be to complete the following:

export LC_ALL="en_US.UTF-8"

I am not sure how to complete this? I have run this in terminal and then when I output the locale I see the following:

LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"

However, when I quit/reopen Terminal the LC_ALL is blank again. Is there something I should run after this?

EDIT - I have seen this link http://perlgeek.de/en/article/set-up-a-clean-utf8-environment but still unable to complete the install of the locale, not sure how.

like image 955
StuartM Avatar asked Mar 22 '23 14:03

StuartM


1 Answers

So there's two ways to approach this, which is reflected in the two types of answers here.

One is to make a permanent change to your environment by changing your shell configuration (e.g. .bashrc or locale defaults). So running this app on another machine will run into similar errors.

The other way is to change this setting as part of the build process of your app, so it will run successfully on any machine - but every time you create a new app using the Cocoapods plugin you'll need to add this script.

My preference is for the latter, so here's how to do that:

Edit your current build scheme - cmd-option-R

Expand Build, and select Pre-actions

Add a New Run Script Action

Then for your script, just add:

export LC_ALL="en_US.UTF-8"

This worked for me. It should look something like this:

enter image description here

like image 106
weissazool Avatar answered Apr 01 '23 19:04

weissazool