【发布时间】:2021-05-24 17:05:26
【问题描述】:
我的项目有 ruby 2.6.5,rails 6,当我尝试运行 bundle install 时,bcrypt gem 没有安装。我尝试了 sudo apt-get install ruby-dev 和 sudo apt-get install build-essential 命令来解决问题,但它们没有帮助。 任何人都可以帮助解决这个问题?
下面是它的日志。
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
【问题讨论】:
-
which mkdir在我的系统上说 /bin/mkdir。您可能在 serverfault 上运气更好,因为这不是编程问题。 -
谢谢@AllanWind 你是对的。下面的命令帮助了我。 sudo ln -s /bin/mkdir /usr/bin/mkdir
标签: ruby-on-rails ruby bcrypt ubuntu-20.04