我已按照 https://github.com/rails/rails-dev-box 设置 vagrant Rails 开发盒的说明进行操作。 。不幸的是,当我尝试捆绑时,我得到以下信息:
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 命令时,我遇到了同样的问题。我做了一些搜索,但很茫然。任何意见都将不胜感激。
最佳答案
这个 bcrypt-ruby gem 正在尝试编译 native (c、c++)代码。 您的虚拟机似乎缺少编译此 native 代码所需的一些工具。
获取虚拟机的 shell:
vagrant ssh
然后安装这些软件包应该可以解决问题:
sudo apt-get install make g++ gcc libssl-dev
之后运行捆绑安装。
关于ruby-on-rails - 无法在 vagrant 机器上安装 bcrypt-ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20960546/