我试着安装Sass.我之前安装了Ruby和MSYS2,这是所有与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)
好的,所以我试图跑 …
假设我有以下 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 处理此问题的最佳方法是什么? …