gpt4 book ai didi

ruby-on-rails - 无法在 ruby​​ on rails 上加载此类文件 -- sqlite3/sqlite3_native (LoadError)

转载 作者:IT王子 更新时间:2023-10-29 06:16:52 25 4
gpt4 key购买 nike

当我尝试在 Ruby 2.0.0 上使用 Rails 4.0.0 设置服务器的基本安装和启动时,我遇到了以下错误消息。

/usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:2:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/penchal/new/site/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

如何避免此错误消息并继续下一步?

最佳答案

找到您的 sqlite3 gemspec 文件。一个例子是 /usr/local/share/gem/specifications/sqlite3-1.3.7.gemspec

window :C:\Ruby21\lib\ruby\gems\2.1.0\specifications.

您应该根据您的 Rubygem 路径和 sqlite3 版本进行调整。编辑上面的文件并查找以下行

s.require_paths=["lib"]

改成

s.require_paths= ["lib/sqlite3_native"]

关于ruby-on-rails - 无法在 ruby​​ on rails 上加载此类文件 -- sqlite3/sqlite3_native (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17643897/

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