R Mac上的C50程序包安装错误:C编译器无法创建可执行文件

R Mac上的C50程序包安装错误:C编译器无法创建可执行文件,r,c,macos,anaconda,R,C,Macos,Anaconda,我正在尝试为R安装软件包C50,但没有成功。 我通过Anaconda使用R,但该软件包在Anaconda环境中不可用,因此我尝试直接从RStudio安装它 RStudio版本为:版本1.1.456 R版本为:3.6.1(2019-07-05) Anaconda版本为:1.9.7 MacOS:Catalina 10.15.3 我既使用了标准的install.packages(“C50”),也使用了GitHub存储库中的直接安装(使用devtools)。 环顾四周,这似乎是一个与SDK头(我不知

我正在尝试为R安装软件包
C50
,但没有成功。 我通过Anaconda使用R,但该软件包在Anaconda环境中不可用,因此我尝试直接从RStudio安装它

  • RStudio版本为:版本1.1.456
  • R版本为:3.6.1(2019-07-05)
  • Anaconda版本为:1.9.7
  • MacOS:Catalina 10.15.3
我既使用了标准的
install.packages(“C50”)
,也使用了GitHub存储库中的直接安装(使用
devtools
)。 环顾四周,这似乎是一个与SDK头(我不知道是什么)以及MacOs系统中目录随时间的演变有关的问题

一次在线搜索把我带到了这里(但我也不知道如何前进):

我在下面重现了在尝试安装软件包时收到的消息:

* installing *source* package ‘Cubist’ ...
** package ‘Cubist’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/sh/hq44lqs10677_vvkvxq01yvh0000gn/T/Rtmpk04dKp/R.INSTALL5020659d63fc/Cubist':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘Cubist’
* removing ‘/opt/anaconda3/lib/R/library/Cubist’
* restoring previous ‘/opt/anaconda3/lib/R/library/Cubist’
Warning in install.packages :
  installation of package ‘Cubist’ had non-zero exit status
* installing *source* package ‘C50’ ...
** package ‘C50’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/sh/hq44lqs10677_vvkvxq01yvh0000gn/T/Rtmp2NjIsn/R.INSTALL50b47eac3131/C50':
configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package ‘C50’
* removing ‘/opt/anaconda3/lib/R/library/C50’
Warning in install.packages :
  installation of package ‘C50’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/sh/hq44lqs10677_vvkvxq01yvh0000gn/T/RtmpdUmDxS/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
另一个提示是查看
config.log
,但我不知道如何找到它


我不知道如何解释这条消息,任何提示都很好。

一种可能是您的
xcode
许可证过期了。尝试运行:

sudo xcodebuild -license

然后同意许可证。

一种可能是您的
xcode
许可证过期。尝试运行:

sudo xcodebuild -license

在命令行中,然后同意许可证。

@trojanfoe我建议尝试一下,因为它在过去为我解决了非常类似的问题。以下是我从中得到的答案:谢谢@Karoliskoncevicius。当我在终端中运行该命令时,我得到:xcode select:error:tool'xcodebuild'需要xcode,但是activedeveloper目录'/Library/developer/CommandLineTools'是一个命令行工具instance@atalantafugiens你能试试
xcode-select--install
first吗?@KarolisKoncevičius,是的,这就是我接下来所做的,但是得到:xcode选择:错误:命令行工具已经安装,请使用“软件更新”来安装updates@trojanfoe我建议尝试一下,因为它在过去为我解决了非常类似的问题。以下是我从中得到的答案:谢谢@Karoliskoncevicius。当我在终端中运行该命令时,我得到:xcode select:error:tool'xcodebuild'需要xcode,但是activedeveloper目录'/Library/developer/CommandLineTools'是一个命令行工具instance@atalantafugiens你能试试
xcode-select--install
first吗?@KarolisKoncevičius,是的,这就是我接下来所做的,但得到:xcode选择:错误:命令行工具已经安装,请使用“软件更新”安装更新