iTerm2 warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory 

【原因】:沒有utf-8這個語系(沒添加語言_國名前綴),LC_ALL又沒設定值。 服務端解決方法: 在遠程系統上, /etc/environment加入以下兩行,重新登陸即可。
<pre><code>LANG=en_US.utf-8
LC_ALL=en_US.utf-8</code></pre>
Mac終端解決方法: 編輯~/.bashrc或者~/.zshrc文件,添加
<pre class=""><code>export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8</code></pre>

Back