Rails 3.2,Heroku弃用警告 - “DEPRECATION WARNING:你有Rails 2.3风格的插件”

时间:2012-01-31 12:01:23

标签: ruby-on-rails ruby ruby-on-rails-3 heroku carrierwave

  

可能重复:
  Rails 2.3-style plugins and deprecation warnings running task in Heroku

几天前,我决定将我的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支持,回复是

  

你好 -

     

最后一行指向Fog的问题 - 一个用于与云提供商(如亚马逊)通信的库。

     

您是否确保已将“雾”宝石添加到您的应用中?

我100%确定宝石在那里,因为你可以看到我的宝石文件。然后又一次回复

  

您是否可以在“生产”模式下在本地重现此问题?

     

如果你将'thin'gem添加到你的Gemfile中,你可以使用'bundle exec thin start -e production'模拟Heroku环境

     

2012年1月30日上午11:43

我已经完成了这一切,一切都在我的本地机器上运行。我对解决方案有点迷茫。我读了这个Rails 2.3-style plugins and deprecation warnings running task in Heroku,我不鼓励将黑客作为解决方案。作为另一种解决方案,我决定将我的应用降级到Rails 3.1,问题仍然存在。我在这里错过了什么?

我怀疑这是来自Carrierwave gem,我已经将其与上传者一起删除了。但是Heroku仍然提到它。我的配置文件中没有任何关于载波的信息。

1 个答案:

答案 0 :(得分:1)

该错误与我所看到的插件或Rails 3.2无关,它们是弃用的。它看起来像你已经错误地卸载了载波。

错误消息指出您仍然有config/initializers/carrier_wave.rb并且仍在尝试引用丢失的CarrierWave对象。

我建议您确保正确删除您的载波,并将其从git中删除。