【问题标题】:Error installing bcrypt using bundle install使用 bundle install 安装 bcrypt 时出错
【发布时间】:2015-12-08 11:18:58
【问题描述】:

我将使用 Debian testing(stretch) 上的 bundle install 在我的 rails 应用程序中安装一些 gem。我收到此错误:

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.

但我已经使用 gem install 安装了 bcryptbcrypt-ruby

【问题讨论】:

  • 您能提及您正在运行的操作系统吗?某些操作系统版本需要安装一些头文件。

标签: ruby-on-rails ruby gem bundler


【解决方案1】:

要编译带有 C 扩展的 gem,您需要安装 ruby-dev 包:

$ sudo apt-get install ruby-dev

【讨论】:

  • 你也安装了build-essential 包吗?
猜你喜欢
  • 1970-01-01
  • 2022-11-22
  • 1970-01-01
  • 2015-06-01
  • 2019-06-07
  • 1970-01-01
  • 2013-10-05
  • 2022-01-17
  • 1970-01-01
相关资源
最近更新 更多