小编Eri*_*icz的帖子

安装Sass时出错(Ruby 2.5.0.1,MSYS2 20161025.0.0)

我试着安装Sass.我之前安装了RubyMSYS2,这是所有与Chocolatey的最新产品:

choco install ruby
choco install msys2
Run Code Online (Sandbox Code Playgroud)

看似他们已正确安装.ruby -v结果是:

ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]
Run Code Online (Sandbox Code Playgroud)

当我尝试运行时gem install sass收到以下错误消息:

ERROR:  Error installing sass:
        The last version of ffi (< 2, >= 0.5.0) to support your Ruby & RubyGems was 1.9.18. Try installing it with `gem install ffi -v 1.9.18` and then running the current command again
        ffi requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.
Run Code Online (Sandbox Code Playgroud)

好的,所以我试图跑 …

ruby sass ffi chocolatey msys2

5
推荐指数
1
解决办法
1661
查看次数

JavaScript:通过字符串数据路径更改 JSON 中的数据

假设我有以下 JSON,它可以轻松地来回转换为 JavaScript 对象:

{
    "foo": {
        "bar": "Common substitute word",
        "baz": "Another common substitute word",
        "questionWords": {
            "wat": "Inadequate question word",
            "wut": "Even more inadequate question word"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我在另一个 JSON 文件中收到有关此 JSON 的修改,如下所示:

{
    "foo.questionWords.wut": "A question word to avoid"
}
Run Code Online (Sandbox Code Playgroud)

所以要修改的路径以字符串形式给出。我必须通过新数据修改第一个 JSON。

但也可能不存在新的数据路径:

{
    "foo.callingWords.dude": "Commonly used synonym for pal"
}
Run Code Online (Sandbox Code Playgroud)

并且新的数据路径可能具有不可确定的深度

{
    "who.knows.how.deep.we.will.go": "Look, a penny!"
}
Run Code Online (Sandbox Code Playgroud)

在没有 JS 库的情况下,仅通过普通的 Vanilia JS 处理此问题的最佳方法是什么? …

javascript json

1
推荐指数
1
解决办法
1143
查看次数

标签 统计

chocolatey ×1

ffi ×1

javascript ×1

json ×1

msys2 ×1

ruby ×1

sass ×1