bcrypt-ruby gem Gem :: Installer :: ExtensionBuildError:

时间:2012-10-26 20:49:10

标签: ruby-on-rails gem bcrypt-ruby

美好的一天。 我正在努力建立一个由其他人工作的项目 当我运行bundle install时,它会因错误而崩溃

Installing bcrypt-ruby (3.0.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:36:in `<main>'


Gem files will remain installed in /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1/ext/mri/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.

sudo gem install bcrypt-ruby -v'3.0.1'

$ sudo gem install bcrypt-ruby -v '3.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt-ruby:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:36:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out

尝试过 - 没有变化 http://rorguide.blogspot.com/2011/02/bundle-install-on-linux-giving-error.html

1 个答案:

答案 0 :(得分:1)

看起来好像没有安装ruby开发库。

看起来您还在使用全局ruby / gems安装,所以最简单的解决方法是安装ruby1.9-dev包(或类似的东西),然后重试。

或者,您可以使用rvm,此问题将自行修复:https://rvm.io/