0

What went wrong? Tried gem install bcrypt, gem install bcrypt-ruby, and getting the same result. Couldn't do bundle install in ruby on rails because of this error.

sylviachoong@sylviachoong:~/Desktop/postco$ gem install bcrypt-ruby
Building native extensions. This could take a while...
ERROR:  Error installing bcrypt-ruby:
        ERROR: Failed to build gem native extension.

    current directory: /home/sylviachoong/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bcrypt- 3.1.12/ext/mri
/home/sylviachoong/.rbenv/versions/2.5.0/bin/ruby -r ./siteconf20180526-3491-4idkgq.rb extconf.rb
creating Makefile

current directory: /home/sylviachoong/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bcrypt-3.1.12/ext/mri
make "DESTDIR=" clean

current directory: /home/sylviachoong/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bcrypt- 
3.1.12/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wduplicated-cond'
Makefile:241: recipe for target 'bcrypt_ext.o' failed
make: *** [bcrypt_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/sylviachoong/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bcrypt-3.1.12 for inspection.
Results logged to /home/sylviachoong/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/bcrypt-3.1.12/gem_make.out

3 Answers3

0

First run this command then install gem

sudo apt-get install libmagickwand-dev
Anand
  • 6,457
  • 3
  • 12
  • 26
  • The error is "gcc: error: unrecognized command line option". It is unlikely that upgrading libmagickwand can fix that, unless by some dependency alchemy gcc is upgraded also. – LSerni Jun 28 '20 at 10:41
0

Ran rbenv install 2.5.1, gem install bundler, and rbenv rehash.

Fixed.

  • This should have been an edit to the question; the root cause was a broken 2.5.1 updated installation. The bug was then fixed in 2.5.3, see: https://github.com/sparklemotion/nokogiri/issues/1817 – LSerni Jun 28 '20 at 10:45
-1

issue command bundle update bcrypt

Andrey
  • 191
  • 2
  • 6
  • The error is "gcc: error: unrecognized command line option". So, it is `gcc` that does not understand the Makefile instructions. It's unlikely that updating bcrypt might fix that. – LSerni Jun 28 '20 at 10:40