错误“没有这样的文件来加载” - sqlite3的/ sqlite3_native(LoadError)

问题描述:

我的操作系统是Windows 7错误“没有这样的文件来加载” - sqlite3的/ sqlite3_native(LoadError)

我的问题是,当我尝试运行rails server,发生错误。我已经安装了sqlite3宝石,甚至是sqlite-ruby宝石,但仍然没有。

我已经不知道该做什么了。

如果有人需要任何额外的信息,请求它,我会把它。

完整的错误是:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError) 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler.rb:120:in `require' 
    from C:/Users/JorWan/Desktop/JorWan/ASCENDSTUDIO/RoR/intento2/config/application.rb:7:in `<top (required)>' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap' 
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
+0

啊,对不起,我忘了说这个错误发生在我尝试做“轨道服务器” – 2011-04-27 07:47:52

下载所需的可执行文件,并从http://www.sqlite.org/download.html 解压到你的红宝石的bin的DLL(C:\ Ruby192 \ BIN)

+0

这与我合作! – Bruno 2011-08-24 21:49:07

+11

我做了这个,它仍然给我同样的错误。 – leen3o 2015-03-16 15:23:05

是该文件(/sqlite3/sqlite3_native)在PATH环境变量?它将需要为了使这个宝石工作。如果您需要在命令提示符下使用echo %PATH%进行检查。 如果它最终需要将其添加到路径中,则可以使用SET PATH=%PATH%;C:\Path\To\Sqlite3或通过在右键单击后选择Properties\Advances\Environment Variables选项来更改环境变量。编辑路径变量以包含您的路径和viola!

+1

没有真正的:/,但是,我该怎么做?我的意思是,这是一个rubygem,不是吗?为什么和/或我该怎么做? – 2011-04-27 08:06:26

+0

不错,thx,我会尝试 – 2011-04-27 08:11:52

+0

我已经设置了环境变量的红宝石斌,并且,sqlite3在那里,知道这一点,我需要设置其他任何东西呢? – 2011-04-27 08:15:11

此URL提供了逐步的说明和解决方案。 希望它适合你。 http://rubyonwindowsguides.github.io/book/ch02-05.html

+0

我按照本教程的指示,无法成功构建sqlite3 gem所需的本地库。另外,本教程中使用的命令并不反映作者坚持下载的链接.tar文件的当前文件名,因此需要编辑几个命令。 – FluffyKittens 2015-07-03 14:51:14

忘记所有的所谓“答案”,不编译源代码或下载预编译的库将解决这个问题,相信我我试了一切,问题出在别的地方。这是它是如何工作的窗口:

bundle update sqlite3

你可能会得到另一个类似的错误这一个关于引入nokogiri后,用命令修复:

bundle update nokogiri

享受你的Ruby应用程序!