为什么bcrypt红宝石不能正确安装? [英] Why won't the bcrypt ruby gem install properly?

查看:15
本文介绍了为什么bcrypt红宝石不能正确安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用bcrypt-ruby,v3.0.1。我在我的gem文件中输入gem如下:

gem 'bcrypt-ruby', '3.0.1'

然后我去终端运行:

bundle install

我收到以下响应:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 
creating Makefile

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


Gem files will remain installed in /Users/philip7899/.bundler/tmp/2186/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /Users/philip7899/.bundler/tmp/2186/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.

我对Ruby和Rails都非常陌生,不知道如何修复这个问题。我看到过其他有类似问题的堆栈溢出页面,但没有一个能够帮助我。我最近升级到了Mountain Lion,有人告诉我这可能是个问题。我被告知要使用RVM卸载并重新安装Ruby。我试过了,但不起作用。

请帮帮忙。谢谢。

推荐答案

尝试删除,'3.0.1'或像这样尝试gem "bcrypt", "~> 3.1.1"

希望它能有所帮助。

如果没有,请尝试从控制台运行gem install bcrypt

这篇关于为什么bcrypt红宝石不能正确安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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