2014-01-06 42 views
2

我按照说明设置了一个https://github.com/rails/rails-dev-box的vagrant rails dev box。不幸的是,当我尝试捆绑我得到以下内容:无法在vagrant机器上安装bcrypt-ruby

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命令时,我得到同样的问题。我已经做了一些搜索,并且无所适从。任何输入是不胜感激。

回答

3

bcrypt-ruby gem试图编译原生(c,C++)代码。 它看起来像您的虚拟机缺少编译此本机代码所需的一些工具。

得到一个shell到VM:

vagrant ssh 

然后安装这些软件包应该解决这一问题:

sudo apt-get install make g++ gcc libssl-dev 

运行包安装后。

+0

热潮!这很好。非常感谢您的意见。如果你有时间可以请你详细说明什么导致你的结论?我想尽可能多地从这个路障中脱身,并更多地了解Unix系统。 – Erik

+0

此消息'sh:1:make:not found'解释了一切:如果没有找到'make'命令,那么相应的软件包没有安装。我做了一个有教养的猜测,如果你没有make,你就不会有编译器(gcc,g ++)。 – mbarthelemy

+0

谢谢,这对我有用。 –

相关问题