27
gem install rails --pre
ERROR:  While executing gem ... (NameError)
    uninitialized constant Psych::Syck

I can't seem to find any info on how to resolve this. Has anyone else had the same problem?

I am using a newly created gemset in RVM with Ruby 1.9.2

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
phoozle
  • 271
  • 3
  • 5

2 Answers2

33

I had exactly same problem on mac via RVM. Specifying version is the rescue for me.

gem install rails --pre --version 3.1.0.rc1

update (2011-06-12) with rubygems 1.8.4, I can install rails 3.1.0.rc4 without specifying the version.

hiroshi
  • 6,871
  • 3
  • 46
  • 59
  • I think without version specified, certain version of rubygems seems to search for older versions of gems and failed to Marshal.load metadata of the old gem because of the old gem's metadata serialized Psych::Syck. Syck is old version of YAML engine, and seems to be dropped by the release of ruby 1.9.2. – hiroshi May 31 '11 at 01:58
  • FWI, I found [a related ticket](http://rubyforge.org/tracker/?group_id=126&atid=575&func=detail&aid=29163). – hiroshi May 31 '11 at 02:37
  • Fixed my problem as well! Thanks! :-D – Mark S. May 31 '11 at 03:42
  • Had the same issue.. Worked.. Thanks a lot! +1 – Tigraine Jun 01 '11 at 21:36
  • This didn't work for me with a very simple gem I was building and installing locally, also with OSX and RVM and rubygems v1.8.5, but doing `gem sources -c`, removing all dependencies from the gemspec and then rebuilding and reinstalling worked for me, no version number needed to be specified. YMMV. You may need to add rvmsudo to those gem commands. – ian Jun 26 '11 at 00:32
12

I had exactly the same problem, and the other solutions mentioned here didn't work for me.

However, this did:

gem update --system
patrick
  • 838
  • 8
  • 11