Fixing Ruby on OS X Yosemite

I get 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 have tried stack overflow suggestions that are related to libyaml and psych. However, many of them require rvm commands that 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 rvm binaries are currently available. Any advice or suggestions on how I can run Ruby 2.0 and work will be greatly appreciated.

Thank!

+4
source share
3 answers

, , , rvm. which ruby. , . , , rvm.

, rbenv rvm. rbenv Ruby, . , temp.

$ 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>

rbenv:

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

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

0
rvm package install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/home/rails/.rvm/usr

,

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

0

, :

1) ruby-build ruby-2.0-p451 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr → ( )

2) , OSX 10.9 --- > WORKS!!

. , : https://gist.github.com/joneslee85/73ece54ba5b3a17e8bb2

. !

-1

Source: https://habr.com/ru/post/1543312/


All Articles