2011-08-24 24 views
0

我反覆出現此問題。我供應我所有的寶石。除了一些像RMagick之外,必須在本地進行編譯。我的寶石規格全部出了問題。然後它會導致失敗的「git pull」部署。Rails 2.3.8應用程序失敗「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 

什麼是一回事呢?這聽起來像在啓動週期中有些東西搞砸了,但一切看起來都找到了。

回答

0

我最終只刪除所有的寶石.specification文件:

從應用程序根目錄:

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

然後:

rake gems:refresh_specs 

一次。完成!