【问题标题】:Ruby failing to run after upgrading (sqlite3_native LoadError); sqlite3 not upgrading properlyRuby 升级后无法运行(sqlite3_native LoadError); sqlite3 没有正确升级
【发布时间】:2019-04-07 19:24:16
【问题描述】:

我已经升级到 ruby​​ 2.5.0,但我到处都有冲突。我检查了以前有关堆栈溢出的帖子,例如:

Ruby on Rails - "Add 'gem sqlite3'' to your Gemfile"

cannot load such file — sqlite3/sqlite3_native

cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails

https://github.com/sparklemotion/sqlite3-ruby/issues/137

但没有一个对我有用。我的问题与这些帖子类似,因为在我运行 rails server 后出现长长的错误消息后,最后几行显示为:

1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in 'block in require' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 'require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

我尝试创建一个新项目,通过 gem 和 minigw 本身重新安装 sqlite3,重新安装 rails 和 ruby​​。我已经尝试了前面问题中的大部分说明,但没有任何效果。 SQLite3 版本 3.25.2、Ruby 2.5.3、rails 5.2.1

抱歉,这可能是一个简单的修复,但我是一个完全的 ruby​​ 初学者,并且我已经尝试了几个小时不同的东西。任何帮助表示赞赏。

【问题讨论】:

    标签: ruby-on-rails ruby sqlite sqlite3-ruby


    【解决方案1】:

    正如这个答案 https://stackoverflow.com/a/49736971/4685144 中所解释的,您现在应该能够使用 git 安装 sqlite3:

    gem 'sqlite3', git: 'https://github.com/sparklemotion/sqlite3-ruby'

    然后bundle install

    【讨论】:

      猜你喜欢
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      • 2021-04-06
      • 2017-01-25
      • 2016-11-06
      • 2017-11-13
      • 1970-01-01
      • 2018-10-19
      相关资源
      最近更新 更多