gpt4 book ai didi

ruby - 无法设置 ruby​​ 环境 - 安装 fii gem 错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:54:08 26 4
gpt4 key购买 nike

我正在尝试为 ruby​​ 项目设置环境。但是当我运行“bundle”时,我在安装“fii”gem 时出错:


Installing ffi (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

/Users/bmalets/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Gem files will remain installed in /Users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1 for inspection.
Results logged to /Users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1/ext/ffi_c/gem_make.out

An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.

我的环境:

  • OS_X 10.8.4

  • ruby 1.9.3p448

  • Xcode 4.6.3

  • libffi-3.0.13

请帮我解决一下。

最佳答案

确保您已安装 Apple Xcode 和命令行工具(查看此屏幕截图):

https://developer.apple.com/technologies/tools/

之后,不要忘记安装 libffi。

1) 如果你使用的是自制软件

brew install libffi

2) 如果你使用的是macport

sudo port install libffi

关于ruby - 无法设置 ruby​​ 环境 - 安装 fii gem 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17775115/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com