【问题标题】:Installing a specific version of sqlite3安装特定版本的 sqlite3
【发布时间】:2019-11-21 09:00:43
【问题描述】:

我有一个问题,我的 CI 构建规范失败,但它们在本地通过。我在两者上都使用相同版本的 ruby​​,并且在两者上都安装了相同的 sqlite3 gem。

我能找到的唯一区别是CI服务器似乎使用的是sqlite3版本:

3.7.17

我的mac哪里安装了sqlite3版本:3.25.1

失败的规范因 SQL 语法错误而失败:

ActiveRecord::StatementInvalid:  SQLite3::SQLException: near "WITH": syntax error: ;WITH included_items

我想在本地测试一下 - 看看是不是因为 Sqlite 版本。我想以某种方式将本地 Mac 版本的 sqlite3 降级到与 CI 服务器相同的版本。

我尝试使用 brew,但似乎找不到任何其他版本的公式。

$ brew install sqlite3@3.7.17
Error: No available formula with the name "sqlite3@3.7.17" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

任何想法如何做到这一点?

【问题讨论】:

    标签: ruby-on-rails sqlite homebrew


    【解决方案1】:

    来自 Formula/sqlite3.rb 的提交日志:

    commit a9ad65c5f2fdc03aa47e4333fcd0df558136b099
    Author: Jack Nagel <jacknagel@gmail.com>
    Date:   Mon May 20 20:25:17 2013 -0500
    
        sqlite 3.7.17
    

    所以基本思路是运行:

    $ COMMIT=a9ad65c5f2fdc03aa47e4333fcd0df558136b099
    $ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/sqlite3.rb
    

    有关更多详细信息,请参阅以下要点: https://gist.github.com/demosten/bdbc4f07c2ddbea0b8f0ad50a98ae5ff

    【讨论】:

    • 我在 url 上找不到 404:raw.githubusercontent.com/Homebrew/homebrew-core/…` exited with 22. 这是输出: curl: (22) The requested URL returned error: 404 Not Found
    • 我将 url 从 sqlite3.rb 更改为 sqlite,现在我收到此错误:错误:sqlite: undefined method `sha1' for #<0x00007fc3be9cbfb0>
    猜你喜欢
    • 2023-03-03
    • 1970-01-01
    • 2020-10-04
    • 2013-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    相关资源
    最近更新 更多