我不知道在Ubuntu :(如何在Ubuntu 16.04安裝mysql2 [錯誤:錯誤安裝mysql2:錯誤:未能建立寶石原生擴展。]
sudo gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/mysql2-0.4.4/ext/mysql2
/usr/bin/ruby2.3 -r ./siteconf20160515-9715-1s2u1sj.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/mysql2-0.4.4 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.4/gem_make.out
命令和apt-get安裝mysql2安裝的libmysqlclient-dev的
Lendo listas de pacotes... Pronto
Construindo árvore de dependências
Lendo informação de estado... Pronto
libmysqlclient-dev is already the newest version (5.7.12-0ubuntu1).
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 61 não atualizados.
但不工作
耙測試 '找不到寶石「mysql2(< 0.5, > = 0.3.13)」這臺機器。' 運行'bundle install'來安裝缺失的寶石。 –
您是否安裝了ruby dev環境? 'sudo apt-get install ruby-dev' – Dawcars
檢查你是否具有構建mysql2 gem本地擴展的所有其他需求。 –