2

When I trying run this command:

gem install bcrypt -v '3.1.10'

After that, I get this error:

current directory: /usr/local/rvm/gems/ruby-2.3.0@app2/gems/bcrypt-3.1.10/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt_blowfish.c
compiling wrapper.c
compiling crypt.c
compiling crypt_gensalt.c
linking shared-object bcrypt_ext.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [bcrypt_ext.so] Error 1

make failed, exit code 2

What I did to solve this problem:

  1. reinstall ruby via rvm
  2. updated and installed packages:
sudo apt-get update

sudo apt-get install curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev make g++ gcc

after that, still get the same error

My environment:

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ lsb_release -r
Release:    14.04
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ rvm -v
rvm 1.26.11 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]

Question: How I can to install bcrypt gem?

3
  • What's the question? Commented Jan 2, 2016 at 17:01
  • Did you run distro-upgrade after apt-get update
    – z atef
    Commented Jan 2, 2016 at 17:16
  • sudo apt-get dist-upgrade - 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    – Pavel
    Commented Jan 2, 2016 at 17:19

1 Answer 1

14

Install libgmp3-dev package.

sudo apt-get install libgmp3-dev

It should do the trick.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.