2012-01-31 106 views
0

可能重複:
Rails 2.3-style plugins and deprecation warnings running task in Heroku的Rails 3.2,Heroku的棄用警告 - 「棄用警告:您的Rails 2.3式插件」

前幾天,我決定升級我的Rails 3.1應用程序到Rails 3.2。無論是在生產環境還是在開發環境中,我的本地機器都能正常運行。當我將應用程序推送到Heroku時,出現錯誤,應用程序崩潰。

錯誤消息:

2012-01-31T11:36:18+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-01-31T11:36:18+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-01-31T11:36:19+00:00 app[web.1]: => Call with -d to detach 
2012-01-31T11:36:19+00:00 app[web.1]: => Booting Thin 
2012-01-31T11:36:19+00:00 app[web.1]: => Rails 3.2.0 application starting in production on http://0.0.0.0:25836 
2012-01-31T11:36:19+00:00 app[web.1]: => Ctrl-C to shutdown server 
2012-01-31T11:36:19+00:00 app[web.1]: Exiting 
2012-01-31T11:36:19+00:00 app[web.1]: /app/config/initializers/carrier_wave.rb:1:in `<top (required)>': uninitialized constant CarrierWave (NameError) 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/engine.rb:587:in `each' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/engine.rb:587:in `block in <class:Engine>' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/config.ru:4:in `block in <main>' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/config.ru:1:in `<main>' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/commands/server.rb:46:in `app' 
2012-01-31T11:36:19+00:00 app[web.1]: from /app/config.ru:1:in `new' 

的Gemfile:

source 'http://rubygems.org' 
gem 'rails', '3.2.0' 
gem 'jquery-rails' 

gem 'devise' 
gem "cancan" 
gem "friendly_id", "~> 4.0.0.beta14" 
gem 'rmagick' 
gem 'ancestry' 
gem "fog" 
gem 'dragonfly', '~>0.9.9' 
gem 'rack-cache', :require => 'rack/cache' 
gem 'tinymce-rails' 

group :development, :test do 
    gem "mysql2", "~> 0.3.11" 
    gem 'sqlite3' 
end 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'pg' 
    gem 'thin' 
    gem 'sass-rails', " ~> 3.2.3" 
    gem 'coffee-rails', "~> 3.2.1" 
    gem 'uglifier', '>= 1.0.3' 

end 


# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 

group :test do 
    # Pretty printed test output 
    gem 'turn', '0.8.2', :require => false 
end 

我通過電子郵件Heroku的支持和響應是

你好 -

最後一行指向霧問題 - 一個用於與雲提供商(如亞馬遜)通信的庫。

你會確保'霧'寶石已被添加到您的應用程序?

我100%肯定的寶石那裏,你可以看到我的寶石file.Then再次另一個響應

您能夠在「生產」模式重現本地這個問題?

如果添加了「薄」寶石到你的Gemfile中,你可以模擬Heroku的環境「捆綁高管薄開始-e生產」

2012年1月30日上午11時43

我已經完成了這一切,並在我的本地機器上運行。我對解決方案有點失落。我讀了這個Rails 2.3-style plugins and deprecation warnings running task in Heroku,我不願意嘗試這種黑客解決方案。作爲另一個解決方案,我決定將我的應用降級到Rails 3.1,問題仍然存在。我在這裏錯過了什麼?

我懷疑這是來自Carrierwave寶石,我已經與上傳器一起移除。但Heroku仍然指它。我的配置文件中沒有關於載波的內容。

+0

您沒有在堆棧跟蹤中提到的config/initializers/carrier_wave.rb文件? – 2012-01-31 12:42:16

+0

不,我刪除了carrier_wave寶石時刪除了它。 – Benjamin 2012-01-31 13:03:56

回答

1

這個錯誤與我所看到的插件或Rails 3.2無關,它們是棄用的。它看起來像你已經錯誤地卸載了carrierwave。

錯誤消息指出您仍然有config/initializers/carrier_wave.rb,並且仍在嘗試引用丟失的CarrierWave對象。

我建議確保您的載波被正確刪除,並且也從git中刪除。

+0

@尼爾米德爾頓,我檢查了很多次,該文件不存在於我的配置文件夾。這就像heroku沒有更新我的應用程序。 – Benjamin 2012-01-31 18:14:20

+0

您的錯誤說不然。檢查你是否已經提交了被刪除的文件,並將該更改推送到Heroku – 2012-01-31 20:41:54

+0

我嘗試了一切,解決問題的唯一方法是預編譯我的資產。 – Benjamin 2012-02-01 11:03:11