0

My project has ruby 2.6.5, rails 6 and when i tried to run bundle install, bcrypt gem is not installing. I tried sudo apt-get install ruby-dev and sudo apt-get install build-essential commands to resolve the issue and they were not helpful. Any one can help on this ?

Below is log for it.

Fetching bcrypt-3.1.11.gem
Building native extensions. This could take a while...
ERROR:  Error installing bcrypt:
ERROR: Failed to build gem native extension.

current directory: /home/mahesh/.rvm/gems/ruby-2.6.5/gems/bcrypt-3.1.11/ext/mri
/home/mahesh/.rvm/rubies/ruby-2.6.5/bin/ruby -I /home/mahesh/.rvm/rubies/ruby- 
2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210222-10360-1tmu5r0.rb extconf.rb
creating Makefile

current directory: /home/mahesh/.rvm/gems/ruby-2.6.5/gems/bcrypt-3.1.11/ext/mri
make "DESTDIR=" clean

current directory: /home/mahesh/.rvm/gems/ruby-2.6.5/gems/bcrypt-3.1.11/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.so

current directory: /home/mahesh/.rvm/gems/ruby-2.6.5/gems/bcrypt-3.1.11/ext/mri
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.time] Error 127

make install failed, exit code 2

Gem files will remain installed in /home/mahesh/.rvm/gems/ruby-2.6.5/gems/bcrypt-3.1.11 for 
inspection.
Results logged to /home/mahesh/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/bcrypt- 
3.1.11/gem_make.out
Mahesh Babu
  • 137
  • 1
  • 10

1 Answers1

2

The package looks for /usr/bin/mkdir but on a Debian based system the correct path is /bin/mkdir. Op solved the problem by creating a symlink. It would be better to fix the installer.

Allan Wind
  • 23,068
  • 5
  • 28
  • 38