使用bundle install安装bcrypt时出错

时间:2015-12-08 11:18:58

标签: ruby-on-rails ruby gem bundler

我将在我的rails应用程序中使用Debian测试(拉伸)上的bundle install安装一些gem。我收到这个错误:

public class MyClass: NSObject, CBCentralManagerDelegate {
    public func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) {

    }
    // I don't want delegate methods to be public, delegate  methods should be like: 
    //func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) {

    //}
}

但我使用Installing bcrypt 3.1.10 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1 Gem files will remain installed in /tmp/bundler20151208-29851-hg3bi3bcrypt-3.1.10/gems/bcrypt-3.1.10 for inspection. Results logged to /tmp/bundler20151208-29851-hg3bi3bcrypt-3.1.10/extensions/x86_64-linux/2.1.0/bcrypt-3.1.10/gem_make.out An error occurred while installing bcrypt (3.1.10), and Bundler cannot continue. Make sure that `gem install bcrypt -v '3.1.10'` succeeds before bundling. 安装了bcryptbcrypt-ruby

1 个答案:

答案 0 :(得分:6)

对于要编译C扩展名的gem,您需要安装ruby-dev包:

$ sudo apt-get install ruby-dev