在 Heroku 中运行任务的 Rails 2.3 样式插件和弃用警告 [英] Rails 2.3-style plugins and deprecation warnings running task in Heroku

查看:23
本文介绍了在 Heroku 中运行任务的 Rails 2.3 样式插件和弃用警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在升级到 Rails 3.2,并且运行 rake db:migrate 给了我几个形式的错误:

I'm upgrading to Rails 3.2, and running rake db:migrate gives me several errors of the form:

弃用警告:您在 vendor/plugins 中有 Rails 2.3 风格的插件!Rails 4.0 中将删除对这些插件的支持.将它们移出并将它们捆绑在您的 Gemfile 中,或者将它们作为 lib/myplugin/* 和 config/initializers/myplugin.rb 折叠到您的应用程序中.有关更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released.(从/app/Rakefile:7 调用)

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 at /app/Rakefile:7)

令人困惑的是,我的 vendor/plugins 目录是空的——它是否引用了另一个插件目录?

What's perplexing is that my vendor/plugins directory is empty -- is there another plugins directory that it's referencing?

推荐答案

你在使用 Heroku 吗?

Are you using Heroku?

Heroku 将在 Rails 3.x 应用程序中注入插件..为避免这种情况在 Rails 3 中注入,在你的项目中包含 rails_12factor gem应用.(Heroku Ruby 支持 2013-10-26)

Heroku will inject plugins in Rails 3.x applications .. To avoid this injection in Rails 3, include the rails_12factor gem in your application. (Heroku Ruby Support 2013-10-26)

rails_12factor gem 在 rails 4 中也是必需的.

The rails_12factor gem is also required in rails 4.

如果您的应用程序中没有此 gem,您将收到一个部署时发出警告,您的资产和日志将不会功能.(Heroku 上的 Rails 4 2013-10-26)

If this gem is not present in your application, you will receive a warning while deploying, and your assets and logs will not be functional. (Rails 4 on Heroku 2013-10-26)

就在 2013-08 年,heroku 总是在 rails 3 应用程序中注入插件,甚至是带有推荐 gems 的应用程序.这是 ruby​​ buildpack 的一个问题,由 PR 11 修复,于 2013 年合并 -08-06.

As recently as 2013-08, heroku always injected plugins in rails 3 apps, even apps with the recommended gems. This was an issue with the ruby buildpack, and was fixed by PR 11, merged on 2013-08-06.

这篇关于在 Heroku 中运行任务的 Rails 2.3 样式插件和弃用警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆