【发布时间】:2012-02-23 03:37:52
【问题描述】:
可能重复:
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'
宝石文件:
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 的问题 - 一个用于与 Amazon 等云提供商通信的库。
您会确保“雾”gem 已添加到您的应用中吗?
我 100% 确定 gem 在那里,因为您可以看到我的 gem 文件。然后再次回复
您能否在“生产”模式下在本地重现此问题?
如果将“瘦”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 仍然提到它。我的配置文件中没有关于载波的任何内容。
【问题讨论】:
-
您没有堆栈跟踪中提到的 config/initializers/carrier_wave.rb 文件?
-
不,我没有,我在移除carrier_wave gem 时移除了它。
标签: ruby-on-rails ruby ruby-on-rails-3 heroku carrierwave