Eu tive o problema semelhante.
% bl0ck_qu0te% Eu corri com sudo apt-get install ruby-dev
.
Eu encontrei a resposta aqui
O seguinte erro ocorreu ao tentar configurar o githubpage na minha máquina local:
Erro exibido:
An error occurred while installing ffi
(1.9.14), and Bundler cannot continue.
Make sure that 'gem install ffi -v '1.9.14''
succeeds before bundling.
Runnign o comando gem install ffi -v '1..9.14' seguinte erro ocorrido.
sudo gem install ffi -v '1.9.14'
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160930-6846-1an2in3.rb 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 /var/lib/gems/2.3.0/gems/ffi-1.9.14 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/ffi-1.9.14/gem_make.out
Então eu olhei para o arquivo de log: gem_make.out que mostrava o seguinte erro
sudo cat /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/ffi- 1.9.14/gem_make.out
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160930-6846-1an2in3.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Ou me sugira o caminho para fazer o download do ruby.h e adicioná-lo nesse local em particular ou me ajudar com o caminho certo, se for instaurado o gem.