Uninitialized constant Syck::Syck (NameError)

It’s old news for you devoted reader, but as you know I love coding with Ruby on Rails  and that’s what my story for today is all about.
I just spent about an hour scratching my head and throwing my keyboard (don’t tell Jobs) around my home office on this issue.

I am upgrading an existing project (guess which…) from rails2 and ruby1.8.7 to rails3 and ruby 1.9.2.

First thing is of course installing bundler and working with the Gemfile (thank god).

So, when I did “bundle install” it crashed on me with this error message:

[shell]
Fetching source index for http://rubygems.org/
/Users/avitzurel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:289:in `load’: uninitialized constant Syck::Syck (NameError)
from /Users/avitzurel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:289:in `_load’
from /Users/avitzurel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:133:in `load’
from /Users/avitzurel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:133:in `fetch_spec’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/remote_specification.rb:47:in `_remote_specification’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/remote_specification.rb:53:in `method_missing’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:101:in `block in __dependencies’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:98:in `each’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:98:in `__dependencies’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:68:in `activate_platform’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:317:in `resolve_requirement’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:287:in `block in resolve’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:286:in `reverse_each’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:286:in `resolve’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:160:in `start’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:128:in `block in resolve’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:127:in `catch’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/resolver.rb:127:in `resolve’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/definition.rb:151:in `resolve’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/definition.rb:90:in `specs’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/definition.rb:85:in `resolve_remotely!’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/installer.rb:43:in `run’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/installer.rb:8:in `install’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/cli.rb:220:in `install’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/vendor/thor/task.rb:22:in `run’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/vendor/thor.rb:263:in `dispatch’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/lib/bundler/vendor/thor/base.rb:386:in `start’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/gems/bundler-1.0.17/bin/bundle:13:in `<top (required)>’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/bin/bundle:19:in `load’
from /Users/avitzurel/.rvm/gems/ruby-1.9.2-p290@rails_3_gogobot/bin/bundle:19:in `<main>’
[/shell]

After digging around the web, reading some useless information that it’s relevance to my issue was close to zero, I updated rubygems on my system to the latest version and this solved the problem.

I executed this command:

[shell]
gem update –system
[/shell]

Hope this saves you some time, if it does, drop me a comment let me know.

Thanks!

6 thoughts on “Uninitialized constant Syck::Syck (NameError)”

Leave a Reply

Your email address will not be published. Required fields are marked *