为了账号安全,请及时绑定邮箱和手机立即绑定

无法在ruby on Rails上加载这样的文件-sqlite 3/sqlite 3

无法在ruby on Rails上加载这样的文件-sqlite 3/sqlite 3

三国纷争 2019-07-03 17:05:36
无法在ruby on Rails上加载这样的文件-sqlite 3/sqlite 3_本机(LoadError)当我尝试使用Ruby2.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>'如何避免此错误消息并继续进行?
查看完整描述

3 回答

?
天涯尽头无女友

TA贡献1831条经验 获得超9个赞

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

窗户:C:\Ruby21\lib\ruby\gems\2.1.0\specifications.

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

s.require_paths=["lib"]

改到

s.require_paths= ["lib/sqlite3_native"]


查看完整回答
反对 回复 2019-07-03
  • 3 回答
  • 0 关注
  • 777 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信