为什么我得到一个bcrypt-ruby gem安装错误? [英] Why do I get a bcrypt-ruby gem install error?

查看:172
本文介绍了为什么我得到一个bcrypt-ruby gem安装错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试安装宝石设计时出现错误,安装程序停止在
gem bcrypt-ruby上:

Getting an error when trying to install the gem devise, the installation is stopping on the gem bcrypt-ruby:

$ gem install bcrypt-ruby
Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.

我正在RVM下使用Ruby运行OSX 10.6.7。
我重新安装了最新版本的xcode&重新安装了Ruby 64bit,Rails和所有的宝石。

I'm running OSX 10.6.7 with Ruby under RVM. I reinstalled the lastest version of xcode & reinstalled Ruby 64bit, Rails and all the gems.

推荐答案

我在OSX 10.7.3下安装同样的问题。安装宝石时,我的错误信息是:

I had the same problem installing under OSX 10.7.3. When installing the gem, my error message was:

Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.

creating Makefile

make
compiling bcrypt_ext.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [bcrypt_ext.o] Error 1

看起来宝石正在寻找gcc -4.2但我只有一个名为gcc的文件。现在,由于我刚刚安装了最新的Xcode(4.3),所以我知道我的C编译器是兼容的,但是gem的gcc-4.2是硬编码的。所以我的解决方案是:

Looks like the gem is looking for gcc-4.2 but I only had a file called gcc. Now since I had just installed the latest Xcode (4.3), I knew that my C compiler was compliant but the gem had gcc-4.2 hardcoded into it. So my solution was:

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

链接的工作方式就像一个魅力。

The linking worked like a charm.

这篇关于为什么我得到一个bcrypt-ruby gem安装错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆