【问题标题】:When I run bundle install i'm getting error with bcrypt gem当我运行 bundle install 时,我遇到了 bcrypt gem 错误
【发布时间】:2014-10-27 15:49:23
【问题描述】:

我无法安装 bcrypt 我的环境 - Mac Yosemite 10.10,Ruby - 1.9.3 p547,Rails - 3.2.15。 当我运行 bundle install 时,我会变成这样。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/mohit/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb 
creating Makefile
make clean
make
compiling bcrypt_ext.c
make: *** [bcrypt_ext.o] Segmentation fault: 11
make failed, exit code 2
Gem files will remain installed in /Users/mohit/.rvm/gems/ruby-1.9.3-p547/gems/bcrypt-3.1.9 for inspection.
Results logged to /Users/mohit/.rvm/gems/ruby-1.9.3-p547/extensions/x86_64-darwin-13/1.9.1/bcrypt-3.1.9/gem_make.out
An error occurred while installing bcrypt (3.1.9), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.9'` succeeds before bundling.
Like

这是我的 Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.15'


 # Bundle edge Rails instead:

 # gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'



 # Gems used only for assets and not required

 # in production environments by default.

group :assets do

  gem 'sass-rails',   '~> 3.2.3'

  gem 'coffee-rails', '~> 3.2.1'


  # See https://github.com/sstephenson/execjs#readme for more supported runtimes

  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'

end

  #gem 'devise'

gem 'jquery-rails'

gem "sorcery"

 # To use ActiveModel has_secure_password

  gem 'bcrypt-ruby'


 # To use Jbuilder templates for JSON

 # gem 'jbuilder'

 # Use unicorn as the app server

 # gem 'unicorn'


 # Deploy with Capistrano

 # gem 'capistrano'


 # To use debugger

 # gem 'debugger'

【问题讨论】:

  • 尝试gem install bcrypt,尝试在您的Gemfile 中更改为gem 'bcrypt', '~> 3.1.7',然后运行bundle install
  • 根据您在 Facebook 上发布的其他信息,您的问题与... stackoverflow.com/questions/25583938/… 重复
  • 您解决了这个问题吗?我有同样的问题 => 分段错误:11

标签: ruby-on-rails gem bcrypt


【解决方案1】:

当我遇到同样的错误时,我发现以下内容可以纠正我的问题:

xcode-select --install
bundle install

值得注意的是,我也在 Yosemite 上,但使用的是 Ruby 2.1.3、Rails 4.1.6。

【讨论】:

  • 我收到xcode-select: error: command line tools are already installed, use "Software Update" to install updates
  • this question 中的步骤有帮助吗?
  • 我也收到了command line tools are already installed, use "Software Update" to install updates 消息。
  • 确保您安装了最新的 XCode for Yosemite(自从升级到 Yosemite 后,我没有使用过我的 XCode)。如果您在升级到优胜美地后还没有这样做,也请重新安装您的 rvm 和 ruby​​。
【解决方案2】:

我通过替换 gem 'bcrypt' 而不是 gem 'bcrypt-ruby' 对 gem 文件进行了更改,并进行了捆绑安装并为我工作!

【讨论】:

    【解决方案3】:

    最后我从 ruby​​gems.org 复制了 bcrypt 的确切单词,然后稍微更改了名称,然后我做了bundle install,它成功了。

    【讨论】:

    • 如果您在此处给出确切的解决方案而不是“谈论它”可能会有所帮助...就像现在的文字一样,这个答案对其他人来说毫无价值。
    猜你喜欢
    • 2021-08-01
    • 2012-04-21
    • 2021-08-02
    • 2020-03-26
    • 2012-02-17
    • 2020-09-04
    • 2016-06-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多