4

I am getting the following error:

/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'
  from /usr/local/bin/hub:190:in `<main>'

I've tried the suggestions on Stack Overflow which are related libyaml and psych. However, many of those require rvm commands which return the following error:

rvm reinstall 2.0
/Users/richardburton/.rvm/src/ruby-2.0.0-p247 has already been removed.
Removing /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247 - please wait
Error running '__rvm_rm_rf /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247',
please read /Users/richardburton/.rvm/log/1401921952_ruby-2.0.0-p247/remove.rubies.log
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.0.0-p247.

Obviously there are a rvm binaries available at this stage. Any tips or suggestions on how I can get Ruby 2.0 up and running would be much appreciated.

Thanks!

Richard Burton
  • 2,230
  • 6
  • 34
  • 49
  • This worked for me: http://stackoverflow.com/questions/24225959/how-to-get-ruby-homebrew-rvm-to-work-on-yosemite/24225960#24225960 – eden Jun 15 '14 at 02:12

3 Answers3

0

The first error you are receiving is referencing your system ruby, and you're reinstalling with rvm. Try running which ruby. Most likely this can be fixed by updating your path. I wouldn't recommend reinstalling the system ruby, so I'd definitely recommend getting whatever was causing the first error to work with rvm.

If that still isn't working, I'd next try using rbenv instead of rvm. I'm personally a fan of rbenv and have had no issues with my Ruby using it. It's super easy to get up and running, and could be a good temp fix.

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # or whichever profile you are using
$ source ~/.bash_profile                           # or whichever profile you are using
$ rbenv install <version number>
$ rbenv global <version number>

Links to rbenv info:

rbenv: https://github.com/sstephenson/rbenv

ruby-build: https://github.com/sstephenson/ruby-build#readme

cadlac
  • 2,802
  • 3
  • 18
  • 34
0
rvm package install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/home/rails/.rvm/usr

I had the same error and this worked for me

Source: https://serverfault.com/questions/442150/how-to-fix-ruby-installation-is-missing-psych-for-yaml-output-on-centos

Community
  • 1
  • 1
noshaf
  • 75
  • 6
-1

I've bumped into the same issue and I have tried two solutions:

1) Using ruby-build to build ruby-2.0-p451 with prefix /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr --> DOES NOT WORK (GOT SEGMENTATION FAULT)

2) Replace with the stock version shipped with OSX 10.9 ---> WORKS!!

Please see my snippet on how to do it here: https://gist.github.com/joneslee85/73ece54ba5b3a17e8bb2

Now I can go to sleep. Good luck!

Trung Lê
  • 5,188
  • 5
  • 27
  • 26