-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
psych/class_loader.rb:99:in `find': Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass) #1895
Comments
jordansissel
added a commit
that referenced
this issue
May 2, 2022
On older rubies, YAML.load _is_ the unsafe load method. At some point, Ruby 3.1.0 / Psych 4(?) made two renames: * YAML.load -> YAML.unsafe_load * YAML.safe_load -> YAML.load A quick test is to try converting a gem. This would fail if `YAML.load` was the "safe" method because it would fail with this message: Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass `fpm -s gem -t empty rails` will crash on Ruby 3.1.0 prior to this commit. Fixes #1895
jordansissel
added a commit
that referenced
this issue
May 20, 2022
On older rubies, YAML.load _is_ the unsafe load method. At some point, Ruby 3.1.0 / Psych 4(?) made two renames: * YAML.load -> YAML.unsafe_load * YAML.safe_load -> YAML.load A quick test is to try converting a gem. This would fail if `YAML.load` was the "safe" method because it would fail with this message: Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass `fpm -s gem -t empty rails` will crash on Ruby 3.1.0 prior to this commit. Fixes #1895 Add necessary classes to safely load yaml from gem specs
jordansissel
added a commit
that referenced
this issue
May 20, 2022
On older rubies, YAML.load _is_ the unsafe load method. At some point, Ruby 3.1.0 / Psych 4(?) made two renames: * YAML.load -> YAML.unsafe_load * YAML.safe_load -> YAML.load A quick test is to try converting a gem. This would fail if `YAML.load` was the "safe" method because it would fail with this message: Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass `fpm -s gem -t empty rails` will crash on Ruby 3.1.0 prior to this commit. Fixes #1895 Add necessary classes to safely load yaml from gem specs
#1898 fixes this. |
#1898 has been merged 2022/05/20 but last release/tag 1.14.2 is from 2022/03/31 so the fix is not live yet :( Could you release a 1.14.3 please? |
jordansissel
added a commit
that referenced
this issue
Nov 4, 2022
On older rubies, YAML.load _is_ the unsafe load method. At some point, Ruby 3.1.0 / Psych 4(?) made two renames: * YAML.load -> YAML.unsafe_load * YAML.safe_load -> YAML.load A quick test is to try converting a gem. This would fail if `YAML.load` was the "safe" method because it would fail with this message: Tried to load unspecified class: Gem::Specification (Psych::DisallowedClass `fpm -s gem -t empty rails` will crash on Ruby 3.1.0 prior to this commit. Fixes #1895 Add necessary classes to safely load yaml from gem specs
fpm 1.15.0 is released and, I believe, has resolve this issue. Please let me know if you find otherwise in a new issue (if a new problem) or this issue (if same problem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fpm -s gem -t deb rails
fpm tries to load a downloaded gem's metadata, it can fail with an error
This seems to be a new failure caused by an upstream ruby or psych change. This ruby psych issue seems related: ruby/psych#487
The above ruby psych change mentions that
safe_load
is now the default (YAML.load
is "safe_load") and the previousload
method has been renamedunsafe_load
.Need to dig a bit more to figure out the best solution that does safe loading, but for now, calling
unsafe_load
when it's available is probably a short fix.The text was updated successfully, but these errors were encountered: