无法在Windows上加载此类文件 - do_sqlite3 / 2.0 / do_sqlite3

时间:2014-05-05 14:46:49

标签: ruby windows sqlite datamapper

据我所知,我已经正确安装了所有内容,但是我仍然无法运行我的程序。要清楚,这是在linux上编写的,我现在正试图在Windows机器上运行它。

我有以下宝石列表:

*** LOCAL GEMS ***

addressable (2.2.7, 2.2.6)
akami (1.2.2)
backports (3.6.0)
bcrypt (3.1.7 x64-mingw32)
bcrypt-ruby (3.1.5 x64-mingw32)
bigdecimal (1.2.0)
builder (3.2.2, 3.1.4)
bundle (0.0.1)
bundler (1.6.2)
daemons (1.1.9)
data_mapper (1.2.0)
data_objects (0.10.14)
dm-aggregates (1.2.0)
dm-constraints (1.2.0)
dm-core (1.2.0)
dm-do-adapter (1.2.0)
dm-migrations (1.2.0)
dm-serializer (1.2.2)
dm-sqlite-adapter (1.2.0)
dm-timestamps (1.2.0)
dm-transactions (1.2.0)
dm-types (1.2.2)
dm-validations (1.2.0)
do_sqlite3 (0.10.14)
encryptor (1.3.0)
fastercsv (1.5.5)
gyoku (1.1.1, 1.1.0)
haml (4.0.5)
httpi (2.1.0)
io-console (0.4.2)
json (1.8.1, 1.7.7)
json_pure (1.8.1)
mail (2.5.4)
mime-types (1.25.1)
mini_portile (0.5.3, 0.5.2)
minitest (4.3.2)
multi_json (1.9.2)
nokogiri (1.6.2.rc2 x64-mingw32)
nori (2.4.0)
polyglot (0.3.3)
pony (1.6.2)
psych (2.0.0)
puma (2.8.2)
rack (1.5.2)
rack-protection (1.5.2)
rack-test (0.6.2)
rake (0.9.6)
rdoc (4.0.0)
rubyntlm (0.3.4)
savon (2.5.0)
sinatra (1.4.4)
sinatra-contrib (1.4.2)
sinatra-static-assets (1.0.3)
sqlite3 (1.3.9 x64-mingw32)
stringex (1.5.1)
test-unit (2.0.0.0)
tilt (1.4.1)
treetop (1.4.15)
uuidtools (2.1.4)
wasabi (3.3.0)

sqlite3是从源代码编译的,并使用gem install sqlite3 -- --with-sqlite3-include=c:/sources/sqlite3 --with-sqlite3-lib=c:/sources/sqlite3/.libs安装成功。

主ruby文件中所需的gem是:

require 'sinatra'
require 'sinatra/static_assets'
require 'sinatra/cookies'
require 'haml'
require 'savon'
require 'encryptor'
require 'pony'
require 'open-uri'
require 'json'
require 'data_mapper'

我应该注意在irb内运行每个需求都返回true而没有错误。运行ruby main.rb时,我遇到了:

c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require': cannot load such file -- do_sqlite3/2.0/do_sqlite3 (LoadError)
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/do_sqlite3-0.10.14/lib/do_sqlite3.rb:32:in `rescue in <top (required)>'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/do_sqlite3-0.10.14/lib/do_sqlite3.rb:27:in `<top (required)>'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-sqlite-adapter-1.2.0/lib/dm-sqlite-adapter/adapter.rb:1:in `<top (required)>'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-sqlite-adapter-1.2.0/lib/dm-sqlite-adapter.rb:1:in `<top (required)>'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from c:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:163:in `load_adapter'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:133:in `adapter_class'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:13:in `new'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/dm-core-1.2.0/lib/dm-core.rb:230:in `setup'
        from rxsite.rb:14:in `<main>'

通常我会经历我迄今为止尝试解决此问题的步骤,但我实际上并不知道从哪里开始。我只能假设我安装sqlite3

的方式存在问题

1 个答案:

答案 0 :(得分:0)

通过删除x64 ruby​​并安装x86 ruby​​来解决此问题。

似乎很多问题源于使用64位版本。