本文介绍了安装ffi(1.1.2)时发生错误,并且Bundler无法继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一个Rails 3.0项目中运行OSX Mountain Lion。当试图在Rails项目中使用bundler更新我的gem时,出现以下错误:
安装ffi(1.1.2)时发生错误,并且Bundler无法继续。
确保在捆绑之前`gem install ffi -v'1.1.2'`成功。
错误:安装ffi时出错:
错误:无法构建gem原生扩展。
/Users/victorstan/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
检查ffi.h ... *** extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。
...
您必须先安装开发工具。
我安装了XCode以及命令行工具。
sudo ln -s / usr / bin / gcc /usr/bin/gcc-4.2
另见和。
Running OSX Mountain Lion, in a Rails 3.0 project.
When trying to update my gems with bundler in a Rails project i get the following errror:
An error occured while installing ffi (1.1.2), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.1.2'` succeeds before bundling.
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
/Users/victorstan/.rvm/rubies/ruby-1.9.2-p320/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.
...
You have to install development tools first.
I have XCode installed as well as command line tools.
解决方案
You should use:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
See also Issue with installing ImageMagick and rmagick on Mountain Lion and https://gist.github.com/1860511.
这篇关于安装ffi(1.1.2)时发生错误,并且Bundler无法继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!