Skip to content
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

NoMethodError: undefined method `tagged_classes' for Psych:Module on Ruby 2.2.0-preview1 #67

Closed
sferik opened this issue Sep 19, 2014 · 12 comments

Comments

@sferik
Copy link

sferik commented Sep 19, 2014

irb(main):001:0> RUBY_VERSION
=> "2.2.0"
irb(main):002:0> require 'safe_yaml'
NoMethodError: undefined method `tagged_classes' for Psych:Module
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:43:in `<module:SafeYAML>'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:26:in `<top (required)>'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in `<top (required)>'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from (irb):2
    from /Users/sferik/.rbenv/versions/2.2.0-preview1/bin/irb:11:in `<main>'

I do not get this error on Ruby 2.1.2, 2.0.0, or 1.9.3.

@iorionda
Copy link

I met a same probrem on Ruby 2.2.0-dev and 2.2.0-preview1
but I do not get this error on Ruby 2.1.3.

@iorionda
Copy link

I confirmed that I worked in master branch.
25e2e15

I wait for release.

@sferik
Copy link
Author

sferik commented Sep 22, 2014

@dtao Would it be possible for you to release safe_yaml version 1.0.4, so I can start testing my gems against Ruby 2.2.0-preview1?

@dtao
Copy link
Owner

dtao commented Sep 26, 2014

Well, great! Yes, I will look into fixing this for Ruby 2.2.0.

@dtao
Copy link
Owner

dtao commented Sep 26, 2014

@sferik, what do you get for YAML::VERSION?

It's very strange—it seems this error must occur because it thinks the YAML engine is Syck, which it clearly isn't since the exception you're seeing shows that YAML and Psych are the same.

Actually, on that note, what do you get when you just type YAML into irb?

I've just installed Ruby 2.2.0-preview1 and am having trouble reproducing this.

@deepj
Copy link

deepj commented Sep 26, 2014

@dtao
It is easy to reproduce with fresh build Ruby 2.2.0preview1 on Mac OS X 10.9.5

$ ruby -v
ruby 2.2.0preview1 (2014-09-17 trunk 47616) [x86_64-darwin13]
$ gem install safe_yaml
Fetching: safe_yaml-1.0.3.gem (100%)
Successfully installed safe_yaml-1.0.3
1 gem installed
$ irb
irb(main):001:0> require 'safe_yaml'
NoMethodError: undefined method `tagged_classes' for Psych:Module
    from /Users/deepj/.gem/ruby/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:43:in `<module:SafeYAML>'
    from /Users/deepj/.gem/ruby/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:26:in `<top (required)>'
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/deepj/.gem/ruby/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in `<top (required)>'
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from (irb):1
    from /Users/deepj/.rubies/ruby-2.2.0-preview1/bin/irb:11:in `<main>'
irb(main):002:0> YAML::VERSION
=> "2.0.6"

@dtao
Copy link
Owner

dtao commented Sep 26, 2014

Oh oh oh, I understand now. I misunderstood @IORI-O's comment that "I worked in master branch": I thought he was saying this issue is reproducible on master; but in fact it looks like it is fixed on master (as of #25e2e15).

I'll issue a new release later today.

@dtao
Copy link
Owner

dtao commented Sep 28, 2014

OK, 1.0.4 released today, which should resolve this issue.

@dtao dtao closed this as completed Sep 28, 2014
briankung added a commit to briankung/react that referenced this issue Feb 12, 2015
safe_yaml 1.0.3 has some issues with Ruby 2.2.0:
dtao/safe_yaml#67
@pdostal
Copy link

pdostal commented Mar 6, 2015

I had this error after I anstalled jekyll and after I installed safe_yaml everything's OK, so thanks 👍

alext added a commit to alphagov/collections-publisher that referenced this issue Apr 17, 2015
Needed to bump safe_yaml to get fix for
dtao/safe_yaml#67
alext added a commit to alphagov/collections-publisher that referenced this issue Apr 17, 2015
Needed to bump safe_yaml to get fix for
dtao/safe_yaml#67
claudiob added a commit to claudiob/rails.github.com that referenced this issue May 3, 2015
Running ruby 2.2.2p95 on my machine, I was not able to start the
application locally: `jekyll --server` would return this error:

```
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/runner.rb:385:in `block in require_program': program version required (Commander::Runner::CommandError)
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/runner.rb:384:in `each'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/runner.rb:384:in `require_program'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/runner.rb:52:in `run!'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/delegates.rb:8:in `run!'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/commander-4.1.6/lib/commander/import.rb:10:in `block in <top (required)>'
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:43:in `<module:SafeYAML>': undefined method `tagged_classes' for Psych:Module (NoMethodError)
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:26:in `<top (required)>'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in `require'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:1:in `<top (required)>'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-1.5.1/lib/jekyll.rb:21:in `require'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-1.5.1/lib/jekyll.rb:21:in `<top (required)>'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-1.5.1/bin/jekyll:7:in `require'
	from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-1.5.1/bin/jekyll:7:in `<top (required)>'
	from ~/.rbenv/versions/2.2.2/bin/jekyll:23:in `load'
	from  .rbenv/versions/2.2.2/bin/jekyll:23:in `<main>'
```

I found this to be a known issue (see [this](dtao/safe_yaml#67), [this](http://stackoverflow.com/questions/29245100/github-pages-error-running-jekyll-locally) and [this](osgi/osgi.enroute.site#8)), and was able to start the application by
running `bundle update jekyll`.
tdooner added a commit to tdooner/synapse that referenced this issue Oct 10, 2015
A bit has changed - mostly adding the ServiceWatcher class in the
hierarchy.

safe_yaml needs upgraded because of:
dtao/safe_yaml#67
hale added a commit to opencounter/accela-rest-ruby that referenced this issue Nov 18, 2015
pachirel added a commit to pachirel/kawasakirb.github.io that referenced this issue Nov 30, 2015
At least, safe_yaml should be 1.0.4 for ruby >= 2.2.0
dtao/safe_yaml#67
@willgdjones
Copy link

Getting this error again with Ruby 2.2.3 and safe_yaml 1.0.3 and running jekyll 2.5.3

@noroot
Copy link

noroot commented Dec 15, 2015

confirm, bug still appears, ~/.rvm/gems/ruby-2.2.3/gems/safe_yaml-1.0.3/lib/safe_yaml/load.rb:43:in module:SafeYAML': undefined method tagged_classes' for Psych:Module (NoMethodError)

@noroot
Copy link

noroot commented Dec 15, 2015

ixed with 1.0.4 safe_yaml version

carvil pushed a commit to alphagov/content-tagger that referenced this issue Jul 20, 2016
Needed to bump safe_yaml to get fix for
dtao/safe_yaml#67
floehopper added a commit to freerange/webhooks that referenced this issue Sep 27, 2016
I was seeing the problem described in dtao/safe_yaml#67.

Upgrading to v1.0.4 fixes this.
ota42y pushed a commit to ota42y/safe_yaml that referenced this issue Aug 14, 2017
mshenfield pushed a commit to mshenfield/CutePets that referenced this issue Sep 23, 2017
Closes codeforamerica#58. 2.4.2 is the latest version of ruby [supported by Heroku](https://devcenter.heroku.com/articles/ruby-support#supported-runtimes). The current version is causing deploys of this app to Heroku to fail.

This also updates various dependencies in the lockfile using `bundle update #{name}` because of issues related to newer versions of ruby.

- `json` [⚠](flori/json#286)
- `safe_yaml` [⚠](dtao/safe_yaml#67)
- `webmock` [⚠] (bblimke/webmock#683)

For folks that have this checked out locally, I also had to `brew install --force` to force an up to date build of `http_parse.rb`, which was throwing `Symbol not found: _rb_cFixnum`.

Finally, this updates petharbor cassette to include URL encoded quotes - this is probably just an internal change to `URI.encode_www_form`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants