简体   繁体   English

无法在 ubuntu 20.04 上安装 bcrypt

[英]Unable to install bcrypt on ubuntu 20.04

My project has ruby 2.6.5, rails 6 and when i tried to run bundle install, bcrypt gem is not installing.我的项目有 ruby 2.6.5,rails 6,当我尝试运行 bundle install 时,没有安装bcrypt gem。 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.我尝试了 sudo apt-get install ruby-devsudo apt-get install build-essential命令来解决问题,但它们没有帮助。 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

The package looks for /usr/bin/mkdir but on a Debian based system the correct path is /bin/mkdir . package 查找/usr/bin/mkdir但在基于 Debian 的系统上,正确的路径是/bin/mkdir Op solved the problem by creating a symlink. Op 通过创建符号链接解决了这个问题。 It would be better to fix the installer.最好修复安装程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM