gpt4 book ai didi

ruby-on-rails - Rails Server Sqlite LoadError

转载 作者:行者123 更新时间:2023-12-01 16:25:33 25 4
gpt4 key购买 nike

当尝试从命令行运行 rails server 命令时,出现以下错误。第一行似乎是最相关的,因为接下来的几行似乎是由于 LoadError 导致的错误。不过,我不太确定。

J:\Github\rails\genepool>rails server
J:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler.rb:133:in `require'
from J:/Github/rails/genepool/config/application.rb:7:in `<top (required)>'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `require'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `tap'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in `server'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from J:/Ruby21/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

我已将 Sqlite3 安装到我的 Ruby 根文件夹 (Ruby21/sqlite)。我还安装了 Sqlite3 gem,并且安装没有返回任何错误。我可以从命令提示符运行 sqlite。这与我将其安装在笔记本电脑上的方式相同,运行良好,所以我在这里真的很茫然。任何帮助表示赞赏。

最佳答案

此问题已在 this 上得到解决关联。您基本上必须从

更改 require 路径
s.require_paths=["lib"]

s.require_paths= ["lib/sqlite3_native"]

您可以在 sqlite3 gemspec 文件中找到它。一个示例是/usr/local/share/gem/species/sqlite3-1.3.7.gemspec 或 'C:\Ruby21\lib\ruby\gems\2.1.0\species'。

关于ruby-on-rails - Rails Server Sqlite LoadError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26415043/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com