1

I'm not able to install bcrypt My environment - Mac Yosemite 10.10, Ruby - 1.9.3 p547, Rails - 3.2.15. When I run bundle install i'm getting like this.

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

Here is my 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'
j-dexx
  • 10,286
  • 3
  • 23
  • 36
Ruby4Rails
  • 81
  • 1
  • 11
  • try `gem install bcrypt`, try making change in your Gemfile as `gem 'bcrypt', '~> 3.1.7'`, then run `bundle install` – bhanu Oct 27 '14 at 15:58
  • Based on the additional info you posted on Facebook, your question is a duplicate of... http://stackoverflow.com/questions/25583938/gem-install-rails-fails-with-dns-error – SteveTurczyn Oct 27 '14 at 18:07
  • have you managed to fix this issue? I have the same problem => Segmentation fault: 11 – bootsa Nov 21 '14 at 12:55

3 Answers3

0

Here's what I found that corrected my problem when I encountered the same error:

xcode-select --install
bundle install

Of note, I'm also on Yosemite but Ruby 2.1.3, Rails 4.1.6.

BigGillyStyle
  • 526
  • 5
  • 4
  • I get `xcode-select: error: command line tools are already installed, use "Software Update" to install updates` – Jankeesvw Oct 31 '14 at 12:37
  • Do the steps in [this question](http://stackoverflow.com/questions/26601184/gemextbuilderror-error-failed-to-build-gem-native-extension-bcrypt-ruby) help out? – BigGillyStyle Nov 04 '14 at 16:35
  • I also get the `command line tools are already installed, use "Software Update" to install updates` message. – Raoot Nov 10 '14 at 09:55
  • Make sure that you have the newest XCode for Yosemite installed (I haven't used mine since I upgrade to Yosemite). Also reinstall your rvm and ruby if you haven't done that yet since your upgrade to Yosemite. – Jay Dinse Nov 28 '14 at 12:28
0

I made changes in the gem file by replacing gem 'bcrypt' instead of gem 'bcrypt-ruby' and did bundle install and worked for me!!

Ruby4Rails
  • 81
  • 1
  • 11
-1

Finally I figured it out by copying the exact word of the bcrypt from the rubygems.org, then made slight changes in name, and then I did bundle install and it worked.

alexwlchan
  • 5,699
  • 7
  • 38
  • 49
Ruby4Rails
  • 81
  • 1
  • 11
  • 1
    It might help if you gave that exact solution here instead of 'talking about it'... As the text is now, this answer is worthless to others. – Jan Doggen Feb 18 '15 at 16:13