Skip to content

Instantly share code, notes, and snippets.

@alloy
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloy/8739bd036d084d8c082b to your computer and use it in GitHub Desktop.
Save alloy/8739bd036d084d8c082b to your computer and use it in GitHub Desktop.
Ruby with Psych bundled as gem can no longer work with YAML if the GEM_PATH environment variable is set incorrectly. (This includes it pointing to another Ruby installation!)
$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin14]
$ env GEM_PATH=/gem/home/without/psych/gem ruby -ryaml -e ''
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- psych (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
@alloy
Copy link
Author

alloy commented Jul 1, 2014

RVM, and possibly other Ruby version managers, appear to automatically configure your profile to set this env variable, pointing to their installation. However, this will break when using a different Ruby and gems that have C extensions.

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