ruby-on-rails - 无法在 vagrant 机器上安装 bcrypt-ruby

标签 ruby-on-rails ubuntu virtualbox vagrant

我已按照 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/

相关文章:

ruby-on-rails - 无法使用 rspec Controller POST 创建操作(设计和 cancan)进行测试

ruby-on-rails - 服务器本地主机 :3000 at Application requires a username and password

写入错误日志的 PHP 错误

virtual-machine - Vagrant:无法从主机 ping 客户机

virtualbox - 虚拟化已启用但不工作

ruby-on-rails - 使用 RVM 更改 ruby​​ 版本后找不到包

ruby-on-rails - 在 Rails 迁移中使用向上/向下与更改/可逆方法有什么区别吗?

linux - 我如何复制一个 bash 实例

mysql - 如何将我的数据库架构 (.mwb) 放在 ubuntu 上的 mysql 服务器上?

c - 读写 mmap 的参数无效?