我打算在我的 Rails 应用程序中使用 bundle 安装在 Debian 测试中安装一些 gem(stretch)。我收到此错误:
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
安装了 bcrypt
和 bcrypt-ruby
。
最佳答案
要编译带有 C 扩展的 gem,您需要安装 ruby-dev
包:
$ sudo apt-get install ruby-dev
关于ruby-on-rails - 使用 bundle install 安装 bcrypt 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34154526/