An error occured while installing ffi (1.1.2), and Bundler cannot continue

你离开我真会死。 提交于 2019-12-01 03:23:34

问题


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.


回答1:


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.




回答2:


If you reinstall command line tools for Xcode, it should work fine. Here is the link to do so: https://developer.apple.com/downloads/index.action?=Command%20Line%20Tools%20%28OS%20X%20Mountain%20Lion%29



来源:https://stackoverflow.com/questions/11725577/an-error-occured-while-installing-ffi-1-1-2-and-bundler-cannot-continue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!