bundle install 安装 ffi (1.9.6) 失败

bundle install fails installing ffi (1.9.6)

ON ubuntu 12.04 Drupalpro 开发虚拟机

Gem::Installer::ExtensionBuildError:错误:无法构建 gem 本机扩展。

            /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:4:in `<main>'


    Gem files will remain installed in /tmp/bundler20150224-3385-1j3fayi/ffi-1.9.6/gems/ffi-1.9.6 for inspection.
    Results logged to /tmp/bundler20150224-3385-1j3fayi/ffi-1.9.6/gems/ffi-1.9.6/ext/ffi_c/gem_make.out
    An error occurred while installing ffi (1.9.6), and Bundler cannot continue.
    Make sure that `gem install ffi -v '1.9.6'` succeeds before bundling.

好的看完这个问题 Answer for `require': no such file to load -- mkmf (LoadError)

  1. 找出您使用的 ruby 版本 $ruby -v
  2. 我的是 ruby 1.8.7
  3. 然后通过$ sudo apt-get install ruby1.8.7-dev
  4. 安装开发版本

安装开发版本后,捆绑器将工作