Skip to content

Instantly share code, notes, and snippets.

@cdlm
Last active August 29, 2015 14:14
Show Gist options
  • Save cdlm/4f90f67ce0fadd40f946 to your computer and use it in GitHub Desktop.
Save cdlm/4f90f67ce0fadd40f946 to your computer and use it in GitHub Desktop.
Psych loading WTF
$ gem list psych
*** LOCAL GEMS ***
psych (2.0.8)
$ ruby -r yaml -e 'puts Psych.methods.include?(:load_file)'
true
$ pry -r yaml
[1] pry(main)> Psych.load_file
ArgumentError: wrong number of arguments (0 for 1)
from /Users/damien/.rbenv/versions/2.2.0/lib/ruby/2.2.0/psych.rb:463:in `load_file'
[2] pry(main)> Psych::load_file
ArgumentError: wrong number of arguments (0 for 1)
from /Users/damien/.rbenv/versions/2.2.0/lib/ruby/2.2.0/psych.rb:463:in `load_file'
[3] pry(main)>
###
### Now let's gem update...
###
$ gem install psych
Fetching: psych-2.0.12.gem (100%)
Building native extensions. This could take a while...
Successfully installed psych-2.0.12
1 gem installed
$ gem list psych
*** LOCAL GEMS ***
psych (2.0.12, 2.0.8)
$ ruby -r yaml -e 'puts Psych.methods.include?(:load_file)'
true
$ pry -r yaml
[1] pry(main)> Psych.load_file
NoMethodError: undefined method `load_file' for Psych:Module
from (pry):1:in `__pry__'
[2] pry(main)> Psych::load_file
NoMethodError: undefined method `load_file' for Psych:Module
from (pry):2:in `__pry__'
[3] pry(main)>
@cdlm
Copy link
Author

cdlm commented Feb 4, 2015

This is with Ruby 2.2.0 under rbenv 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment