Fix Issue with Psych Yaml gem on RVM and OSX

How to fix the issue with path2class error using RVM and OSX

Every now and then you may see a path2class error when using ruby 2.0, rvm and pysch gem. This issue is typically caused on your OS X machine. To fix the issue, when getting something like:

.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych/syntax_error.rb:5:in `<module:Psych>': superclass mismatch for class SyntaxError (TypeError)

Do the following:

rvm reinstall 2.0.0-p353 --disable-binary

If you get a message where you have to update your XCode install, go ahead and do that. You may run into an rvm build error (eg. “Error running ‘make -j8’…”).

To fix the issue with the RVM build issue, run the following:

rvm get stable
rvm autolibs enable
rvm reinstall 2.0.0-p353 --disable-binary --with-gcc=clang

Note if the problem is with a fresh install of rvm on OSX run the following:

rvm get stable
rvm autolibs enable
rvm install ruby || rvm install ruby --with-gcc=clang