macos 如何修复“tar:无法设置默认语言环境”错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3907719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:16:13  来源:igfitidea点击:

How to fix 'tar: Failed to set default locale' error?

rmacoslocaletar

提问by gakera

I'm trying to install a package into R, something I swore on my blood never to do, yet here I am.

我正在尝试将一个软件包安装到 R 中,这是我发誓永远不会做的事情,但我在这里。

The command supposedly goes:

该命令应该是:

install.packages('NCStats',,'http://www.rforge.net/')` while I am enjoying the healthy dose of:

Warning: dependencies 'nortest', 'plotrix', 'sciplot', 'car', 'gplots', 'gdata', 'Hmisc', 'TeachingDemos' are not available  
trying URL 'http://www.rforge.net/bin/macosx/leopard/contrib/2.11/NCStats_0.1-4.tgz'  
Content type 'application/x-gzip' length 237120 bytes (231 Kb)  
opened URL  
=================================================="  
downloaded 231 Kb  
tar: Failed to set default locale  
The downloaded packages are in
    /var/folders/Qj/Qjps7xnxFcWdSHsJY3lo+k+++TI/-Tmp-//RtmpzNO8MM/downloaded_packages`

Le-sigh. Anybody know how I can tell tar what locale I'm in, not that I understand why it needs that or why it can't just know it already?

乐叹。任何人都知道我如何告诉 tar 我所在的语言环境,而不是我理解它为什么需要那个或者为什么它不能知道它?

I'm running OSX 10.6.4 and R 2.11.1 GUI 1.34 Leopard build 64-bit (5589).

我正在运行 OSX 10.6.4 和 R 2.11.1 GUI 1.34 Leopard build 64 位 (5589)。

回答by Brandon Bertelsen

Step 1 (In R Console)

第 1 步(在 R 控制台中)

system('defaults write org.R-project.R force.LANG en_US.UTF-8')

Step 2: Restart R

第 2 步:重新启动 R

Source: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Internationalization-of-the-R_002eapp

资料来源:http: //cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Internationalization-of-the-R_002eapp

回答by IUF

Use this command in the R console:

在 R 控制台中使用此命令:

system("defaults write org.R-project.R force.LANG en_US.UTF-8")

Remember to quit and start again R.

记住退出并重新开始R。

回答by Pranav Bhat

  • Better Close the entire R studio and Reopen it again will fix that error tar: Failed to set default locale
  • 最好关闭整个 R 工作室并再次重新打开它会修复该错误 tar: Failed to set default locale