Comments (5)
As a quick fix, changing here
class Date
# This one's easy enough :)
to
class Date
require 'time'
# This one's easy enough :)
seems to fix it
from safe_yaml.
i was having the same problem when upgrading from ruby version 2.4.2 to 2.5.0
$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468)
$ cat Gemfile.lock | grep -i 'test-kitchen ([0-9]'
test-kitchen (1.19.2)
applying @javierbertoli quick fix resolved my pain.
wonder why i just got this error when the initial issue date it set back to Oct 18, 2015 and @javierbertoli resolution was not pushed to the upstream or any other suitable fix...
any idea?
from safe_yaml.
i'm having this error occur on debian/buster
$ kitchen
/var/lib/gems/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb:22:in `<class:Date>': uninitialized constant SafeYAML::Parse::Date::DateTime (NameError)
Did you mean? SafeYAML::Parse::Date::DATE_MATCHER
from /var/lib/gems/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb:3:in `<class:Parse>'
from /var/lib/gems/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb:2:in `<module:SafeYAML>'
from /var/lib/gems/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb:1:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/lib/gems/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/load.rb:14:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /var/lib/gems/2.3.0/gems/test-kitchen-1.19.2/lib/kitchen/loader/yaml.rb:21:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/lib/gems/2.3.0/gems/test-kitchen-1.19.2/lib/kitchen.rb:42:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/lib/gems/2.3.0/gems/test-kitchen-1.19.2/lib/kitchen/cli.rb:21:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/lib/gems/2.3.0/gems/test-kitchen-1.19.2/bin/kitchen:10:in `<top (required)>'
from /usr/local/bin/kitchen:22:in `load'
from /usr/local/bin/kitchen:22:in `<main>'
$ ruby --version
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
$ gem list --local | egrep "test-kitchen|safe_yaml"
safe_yaml (1.0.4)
test-kitchen (1.19.2)```
from safe_yaml.
confirmed, @javierbertoli
that Works For Meβ’
thanks!
from safe_yaml.
@y0y0z My only guess is that somebody somewhere was doing a require 'date'
or require 'time'
which pulls in the DateTime
class and this was happening before safe yaml got invoked.
Top level constant names are a nasty little bit of global state in Ruby...
from safe_yaml.
Related Issues (20)
- Tests fail with Ruby 3.0
- Starting with Ruby 3.4.0, base64 will no longer be part of stdlib HOT 3
- Video
- support type casting HOT 1
- uninitialized constant Psych::Nodes (NameError) HOT 44
- Ruby 2.2.0 - undefined method `tagged_classes' for Psych:Module (NoMethodError) HOT 4
- uninitialized constant Syck (NameError) after update from Ruby 2.1.6 to Ruby 2.2.2 HOT 6
- Multi line + tab HOT 1
- safe_yaml vs Psych safe_load HOT 1
- No support for load_stream
- merges don't work in syck on ruby 2.2 with strict safety HOT 1
- merges fail with empty common block
- uninitialized constant error (Ruby Sinatra)
- Revisiting #35: Discarding timezone data HOT 2
- BigDecimal value 0.0, converted to 1080.0 !!!
- Invocations different across Platforms
- Invasion of phone system privacy HOT 5
- Document when to use `safe_yaml` vs `YAML.safe_load`
- Is `deserialize_symbols` still a valid safety concern?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safe_yaml.