ruby - 无法使用 rbenv 安装 Ruby 2.5.1,导致 C 编译器错误
问题描述
我正在尝试设置一台新机器并准备开发环境。我的 Xcode 和命令行工具都安装好了。我使用自制软件安装 ruby-build 和 rbenv。然后我执行命令:
rbenv install 2.5.1
但是我收到以下错误:
BUILD FAILED (OS X 10.14.2 using ruby-build 20181225)
Inspect or clean up the working tree at /var/folders/
kk/d2c_1jqj2dd88mcscwsrcz_w0000gp/T/ruby-build.201901
18184337.15691
Results logged to /var/folders/kk/d2c_1jqj2dd88mcscws
rcz_w0000gp/T/ruby-build.20190118184337.15691.log
Last 10 log lines:
checking build system type... x86_64-apple-darwin18.2.0
checking host system type... x86_64-apple-darwin18.2.0
checking target system type... x86_64-apple-darwin18.2.0
checking whether the C compiler works… no
configure: error: in
`/var/folders/kk/d2c_1jqj2dd88mcscwsrcz_w0000gp/T/ruby
build.20190118184337.15691/ruby-2.5.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
./configure: line 346: sort: No such file or directory
./configure: line 343: sed: No such file or directory
make: *** No targets specified and no makefile found.
Stop.
我已经尝试进入日志以查看是否可以在那里看到一些东西,但什么也没有。
我曾尝试寻找解决方案,但无济于事。
如果有人能帮助我指出正确的方向并帮助我解决这个问题,我将不胜感激。
谢谢!
解决方案
您的主文件夹的名称是什么?rbenv不喜欢主文件夹名称中的空格。应该更换或移除它们。
推荐阅读
- function - 如何正确调用张量流中的函数
- java - 当我们使用关键字“throws”时,谁为我们处理异常?
- ruby-on-rails - 版本 5.1.12 后的乘客独立问题 / Nginx / Rails
- reactjs - 拉动 Scrollview 以显示 View - React Native
- amazon-web-services - 如何使用 Amazon Lex 从客户那里获取语音输入并使用 amazon connect 将该信息传递到正确的路径?
- powershell - 如何停止 powershell 舍入数字
- javascript - 点击后如何隐藏按钮
- node.js - 在 Docker 上构建 vue/quasar 应用程序时出错
- hazelcast - 使用 Hazelcast Helm 时如何启用 CP 子系统
- c# - 无法在 Asp.net Web 窗体应用程序中填充网格 onclick 事件