$ sudo apt-get install sqlite3 $ sudo gem install sqlite3-ruby Attempting local installation of 'sqlite3-ruby' Local gem file not found: sqlite3-ruby*.gem Attempting remote installation of 'sqlite3-ruby' Select which gem to install for your platform (i386-linux) 1. sqlite3-ruby 1.1.0 (mswin32) 2. sqlite3-ruby 1.1.0 (ruby) 3. sqlite3-ruby 1.0.1 (ruby) 4. sqlite3-ruby 1.0.1 (mswin32) 5. sqlite3-ruby 1.0.0 (mswin32) 6. sqlite3-ruby 1.0.0 (ruby) 7. sqlite3-ruby 0.9.0 (ruby) 8. sqlite3-ruby 0.9.0 (mswin32) 9. sqlite3-ruby 0.6.0 (ruby) 10. sqlite3-ruby 0.5.0 (ruby) 11. Cancel installation > 2 Building native extensions. This could take a while... can't find header files for ruby. ERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension. Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0 for inspection. ruby extconf.rb install sqlite3-ruby\n Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/ext/sqlite3_api/gem_make.out $ cat /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/ext/sqlite3_api/gem_make.out ruby extconf.rb install sqlite3-ruby
さて、どうしたもんだろう。 "can't find header files" っていっても具体的にどれよ?
→ 解決! どうやら、 ruby-devel が入っていなかったのが原因だったようだ。
$ sudo apt-get install ruby-devel $ sudo gem install sqlite3-ruby
としたら解決した。
参考: http://wiki.rubyonrails.com/rails/pages/HowtoUseSQLite の "Possible Gotchas", "Q: I get errors when trying to install the gem ..." の項。 ruby.h が必要らしい、ということは、ここを見て初めて分かった。