Subscribed unsubscribe Subscribe Subscribe

@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

= ubuntuでsqlite3とruby1.9.1の組み合わせ

[2011-10-28 19:39:18]

ubunturubyからsqlite使ってみようと思ってsqlite3入れてみたけどrequireできひんしgemのインストールにも失敗する.

% sudo gem1.9.1 install sqlite3-ruby --http-proxy=$http_proxy
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
       ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)
       from <internal:lib/rubygems/custom_require>:29:in `require'
       from extconf.rb:3:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/sqlite3-1.3.4 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out

これ見つけた. Errors on 'gem install mysql2' - Adam Caudill

rubyのdevパッケージとlibsqlite3-ruby1.9.1いれればいいみたいsqlite3の部分はいろんなデータベースの名前があるみたい.あとpython用とかほかにもいろいろあった.

% sudo apt-get install ruby1.9.1-dev libsqlite3-ruby1.9.1

そしたら動いた.

% irb1.9.1
irb(main):001:0> require 'sqlite3'
=> true