Git Product home page Git Product logo

Comments (5)

dearblue avatar dearblue commented on August 16, 2024 1

psych 4 では Psych.loadPsych.safe_load 相当に変更されたようです。
ruby/psych#487

もし psych 4.0.0 に対応させるとしたら、次の2つが考えられます:

  • YAML.load / YAML.load_file メソッドに permitted_classes: [Time], aliases: true キーワード引数を与える

    例えば:

    YAML.load_file(".narou/database.yaml", permitted_classes: [Time], aliases: true)

    safe_load メソッドであれば、Ruby 2.6 にバンドルされている psych 3.1.0 以降であればキーワード引数に対応しているようです。
    もっとも Ruby 2.5 に入っている psych 3.0.2 はキーワード引数に対応していないようです (でも古いので諦めても良いように思います)。

  • YAML.unsafe_load メソッドを使う

    この unsafe_load メソッドは、psych 3.3.2 から追加されています。

from narou.

whiteleaf7 avatar whiteleaf7 commented on August 16, 2024 1

@saosamu @topstone @dearblue
ありがとうございます! #387 で修正しました
後ほどバージョン更新しておきます

from narou.

saosamu avatar saosamu commented on August 16, 2024

補足。
どうも x64-mingw32 に絡むトラブルっぽいですので,恐らく narou.rb 側での問題ではないです。
もう少し調べてみます。

from narou.

topstone avatar topstone commented on August 16, 2024

ここに書くほどのことでもないですが、以下の内容の Gemfile を用意して bundle exec narou *******
でも動きますね。

私の環境では psych 4.0.0 を消す代わりにこの方法で対処しました。 (psych の問題が解決した後は、Gemfile を削除する方が良いです。)

gem 'narou'
gem 'psych', '~> 3.0'

from narou.

whiteleaf7 avatar whiteleaf7 commented on August 16, 2024
 ag "YAML.load" -l | xargs sed -i '' -e "s/YAML.load/YAML.unsafe_load/g"

from narou.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.