Windows 下 Ruby2.0 安装 Sqlite3 的 gem 包,使用 Devkit 编译 Native 通过,但启动 rails console
或 rails server
时出错,找不到 native_sqlite
退回 Ruby1.9.3,编译 Native 没有问题;检查了下 1.9.3 下编译通过的 sqlite 包,sqlite3-1.3.7-x86-mingw32 的\lib\sqlite3
目录下,有针对 1.8 和 1.9 的目录,目录下是“sqlite3_native.so”;对照检查 Ruby2 下的 sqlite 对应目录结构,下面也只有 1.8/1.9 的目录;
推断,应该是 sqlite3 目前只支持 Ruby1.9,还未支持 Ruby2.0。待确认.....
D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/sqlite3.r
b:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/
lib/sqlite3.rb:6:in `rescue in <top (required)>'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/
lib/sqlite3.rb:2:in `<top (required)>'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:72:in `require'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:72:in `block (2 levels) in require'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:70:in `each'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:70:in `block in require'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:59:in `each'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/
runtime.rb:59:in `require'
from D:/ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler.
rb:132:in `require'