Rails 2.3.8 应用程序中失败"git pull"头痛



我反复遇到这个问题。我卖掉了我所有的宝石。除了一些,像RMagick,必须在本地编译。我的宝石规格都不正常。然后它会导致"git pull"部署失败。

现在我的生产应用程序甚至无法启动。当我尝试运行

时,最荒谬和无益的错误:
rake gems:refresh_specs --trace

结果如下:

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

是关于什么的?听起来好像在启动周期中有什么东西搞砸了,但在我看来一切正常。

我最终只是删除了所有的gem .specification文件:

从应用程序根目录:

find . -name ".specification" -exec rm -rf {} ;

:

rake gems:refresh_specs

。完成了!

最新更新