在安装FFI(1.1.2)时发生错误,并且捆扎机无法继续(An error occured whil

2019-06-26 14:48发布

运行OSX山狮,在Rails 3.0的项目。

当试图在Rails项目我碰到下面的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.

我安装的XCode以及命令行工具。

Answer 1:

您应该使用:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

另请参见发行与山狮ImageMagick的安装和rmagick和https://gist.github.com/1860511 。



Answer 2:

如果您重新安装的Xcode命令行工具,它应该工作的罚款。 这里是这样做的链接: https://developer.apple.com/downloads/index.action?=Command%20Line%20Tools%20%28OS%20X%20Mountain%20Lion%29



文章来源: An error occured while installing ffi (1.1.2), and Bundler cannot continue