问题描述
我已经按照 https://github 上的说明设置了一个 vagrant rails dev box.com/rails/rails-dev-box.不幸的是,当我尝试捆绑时,我得到以下信息:
I have followed the instructions for setting up a vagrant rails dev box from https://github.com/rails/rails-dev-box. Unfortunately when I attempt to bundle I get the following:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/vagrant/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
sh: 1: make: not found
make "DESTDIR="
sh: 1: make: not found
make failed, exit code 127
Gem files will remain installed in /home/vagrant/.rvm/gems/ruby-2.0.0-p353/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /home/vagrant/.rvm/gems/ruby-2.0.0-p353/extensions/x86-linux/2.0.0/bcrypt-ruby-3.0.1/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot
continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.
当我尝试运行该 gem install 命令时,我遇到了同样的问题.我做了一些搜索,不知所措.非常感谢任何输入.
When I try and run that gem install command I get the same issue. I have done some searching and am at a loss. Any input is greatly appreciated.
推荐答案
这个 bcrypt-ruby
gem 试图编译原生 (c, c++) 代码.您的 VM 似乎缺少编译此本机代码所需的一些工具.
This bcrypt-ruby
gem is trying to compile native (c, c++) code.It looks like your VM is missing some tools required to compile this native code.
获取 VM 的 shell:
Get a shell to the VM:
vagrant ssh
然后安装这些包应该解决问题:
Then installing these packages should solve the issue:
sudo apt-get install make g++ gcc libssl-dev
之后运行 bundle install.
Run bundle install after that.
这篇关于无法在流浪机器上安装 bcrypt-ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!