2013-03-31 27 views
0

我遵循github上的所有步骤以及Ruby on rails安装的官方文档。 我已经安装了sqlite3的gem。 另外,我抄的DLL和DEF文件和SQLite到Ruby/bin中的.exe文件 然后我创建了一个示例应用程序称为MYAPP并试图通过命令来启动服务器“轨服务器”命令“rails server”上的Ruby on rails错误

它给以下错误:

F:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/sqlite3.rb:6:i 
n `require': cannot load such file -- sqlite3/sqlite3_native (LoadError) 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/s 
qlite3.rb:6:in `rescue in <top (required)>' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7-x86-mingw32/lib/s 
qlite3.rb:2:in `<top (required)>' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:72:in `require' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:72:in `block (2 levels) in require' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:70:in `each' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:70:in `block in require' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:59:in `each' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti 
me.rb:59:in `require' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler.rb:13 
2:in `require' 
     from F:/myapp/config/application.rb:7:in `<top (required)>' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma 
nds.rb:24:in `require' 
     from F:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma 
nds.rb:24:in `<top (required)>' 
     from script/rails:6:in `require' 
     from script/rails:6:in `<main>' 

这是 “捆绑列表” 的输出指令:

F:\myapp>bundle list 
Gems included by the bund 
    * actionmailer (3.2.13) 
    * actionpack (3.2.13) 
    * activemodel (3.2.13) 
    * activerecord (3.2.13) 
    * activeresource (3.2.1 
    * activesupport (3.2.13 
    * arel (3.0.2) 
    * builder (3.0.4) 
    * bundler (1.3.4) 
    * coffee-rails (3.2.2) 
    * coffee-script (2.2.0) 
    * coffee-script-source 
    * erubis (2.7.0) 
    * execjs (1.4.0) 
    * hike (1.2.1) 
    * i18n (0.6.1) 
    * journey (1.0.4) 
    * jquery-rails (2.2.1) 
    * json (1.7.7) 
    * mail (2.5.3) 
    * mime-types (1.22) 
    * multi_json (1.7.2) 
    * polyglot (0.3.3) 
    * rack (1.4.5) 
    * rack-cache (1.2) 
    * rack-ssl (1.3.3) 
    * rack-test (0.6.2) 
    * rails (3.2.13) 
    * railties (3.2.13) 
    * rake (10.0.4) 
    * rdoc (3.12.2) 
    * sass (3.2.7) 
    * sass-rails (3.2.6) 
    * sprockets (2.2.2) 
    * sqlite3 (1.3.7) 
    * thor (0.18.1) 
    * tilt (1.3.6) 
    * treetop (1.4.12) 
    * tzinfo (0.3.37) 
    * uglifier (1.3.0) 

请HEL p我..我非常渴望在RoR中创建webapps,但我坚持这些错误。 在此先感谢。

+0

你将不得不从[这里](HTTP下载DLL:// WWW。 sqlite.org/download.html),然后将它添加到你的'F:/ Ruby200/bin'文件夹中。同样的问题[这里](http://stackoverflow.com/questions/7604049/no-such-file-to-load-sqlite3-sqlite3-native),[这里](http://stackoverflow.com/questions/5745322/require-no-such-file-to-load-sqlite3-sqlite3-native-loaderror)and [here](http://stackoverflow.com/questions/5800920/error-no-such-file-to-load- sqlite3的-sqlite3的母语 - loaderror)。 –

+0

我上面已经写过,我已经提取了可执行文件和dll到Ruby/bin文件夹......仍然没有工作......在我无法理解的bundler.rb和config.rb中存在问题。参考上面的cmd输出。我不认为它只涉及sqlite3 – Andre

回答

0

下载所需的可执行文件,并从http://www.sqlite.org/download.html解压到你的Ruby的bin中的DLL(F:\ Ruby200 \ BIN)


如果您检查sqlite3的源代码:

# support multiple ruby version (fat binaries under windows) 
begin 
    RUBY_VERSION =~ /(\d+\.\d+)/ 
    require "sqlite3/#{$1}/sqlite3_native" 
rescue LoadError 
    require 'sqlite3/sqlite3_native' 
end 

您应用程序中断需要'sqlite3/sqlite3_native',您可以执行irb并尝试加载该文件,并且它应该失败,修复该问题,并且您的应用程序应该运行时没有任何问题。

确保包含路径的Ruby on%PATH%的二进制文件,所以当你执行需要“sqlite3的/ sqlite3_native”它实际上有该文件的有效路径。

你也可以通过添加您的boot.rb文件尝试:

$LOAD_PATH.unshift('F:/Ruby200/bin') 

因此应用程序,当你需要使用相对路径的文件的sqlite3/sqlite3_native它实际上可以找到该文件。

一旦你能够加载该文件,它应该工作或段故障漏洞(其窗口:P)

+0

我已经写了上面,我已经提取可执行文件和dll到Ruby/bin文件夹...仍然没有工作......有bundler.rb和config.rb中的问题,我我无法理解。参考上面的cmd输出。我不认为它只是与sqlite3 – Andre

+0

相关你是否也更新了%PATH%?我100%肯定它与DLL的问题,检查错误信息,它不能更加清楚:“'需要':无法加载这样的文件 - sqlite3/sqlite3_native(LoadError)”,你可以检查源代码sqlite3以及无法加载的驱动程序。 – rorra

+0

非常感谢..我将LOAD_PATH语句添加到boot.rb文件,但没有$符号,因为它给出了相同的sqlite3错误。现在只有2个错误显示如下:F:\ myapp>软件包检查 Gemfile的依赖性得到满足 F:\ myapp> rails server F:/myapp/config/boot.rb:1:in <' – Andre