Failed "git pull" headaches in Rails 2.3.8 application
I have this problem repeatedly. I vendor all my gems. Except some, like RMagick, have to be compiled locally. My gems specs get all out of whack. Then it causes failed "git pull" deployments.
So now my production application won't even start. The most ridiculous and unhelpful error when I try to run:
rake gems:refresh_specs --trace
Here's what I get:
rake aborted!
syntax error on line 127, col 0: `rubygems_version: 1.5.2'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/yaml.rb:133:in `load'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/yaml.rb:133:in `load'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/yaml.rb:144:in `load_file'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/yaml.rb:143:in `open'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/yaml.rb:143:in `load_file'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:110:in `load_specification'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:48:in `refresh!'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:45:in `each'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:45:in `refresh!'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:29:in `initialize'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21:in `new'
/home/projects/xxx/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path'
/home/projects/xxx/config/boot.rb:47:in `load_initializer'
/home/projects/xxx/config/boot.rb:38:in `run'
/home/projects/xxx/config/boot.rb:11:in `boot!'
/home/projects/xxx/config/boot.rb:110
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
/home/projects/xxx/Rakefile:4
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby-enterprise-1.8.7开发者_高级运维-2011.01/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/opt/ruby/bin/rake:19:in `load'
/opt/ruby/bin/rake:19
What is that all about? It sounds like there is something messed up during the boot cycle, but everything looks find to me.
I ended up just removing all the gem .specification files:
From application root directory:
find . -name ".specification" -exec rm -rf {} \;
Then:
rake gems:refresh_specs
again. Done!
精彩评论