【问题标题】:DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support will be removed in Rails 4.0 [duplicate]弃用警告:您在供应商/插件中有 Rails 2.3 风格的插件! Rails 4.0 中将删除支持 [重复]
【发布时间】:2012-04-23 04:38:30
【问题描述】:

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

我正在运行 rake db:migrate 给我以下警告,然后中止:

$ heroku rake db:migration --trace
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support forthese 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/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /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/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /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/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
Don't know how to build task 'db:migration'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task_manager.rb:49:in `[]'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:115:in`invoke_task'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `load'
/app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `<main>'

当我检查vendor/plugins 文件夹时,我只发现了一个名为.gitkeep 的文件并且是空的

【问题讨论】:

    标签: ruby-on-rails git heroku rake dbmigrate


    【解决方案1】:

    vendor/plugins 不是这里的问题,这些只是警告。这是heroku run rake db:migrate..

    如果您不在 Cedar 堆栈中,可能只是 heroku rake db:migrate(注意 migrate,而不是 migration

    【讨论】:

    • 虽然显示的错误的“问题”不是弃用,但问题(标题)似乎与弃用消息有关,其在可能重复的问题中进行了解释
    • 嘿,不记得回答这个问题了。我猜那是 2 年前 - 下面的答案和 cmets 对于弃用消息是正确的。 Heroku 将插件注入到供应商/插件中,以便您的应用程序可以在 heroku 堆栈上运行。将 gem rails_12factor 添加到您的 Gemfile(如下所述)将删除这些警告。
    • 好的,我只是在争论这个答案是否被标记为这个问题的“正确”答案,这会造成一些混乱。
    • 这是在 Hesham 上的。我同意这个不应该被标记为正确。
    【解决方案2】:

    仅供参考,以防人们由于问题标题而从搜索引擎到达这里。 弃用警告是由 Heroku 注入插件引起的 - 请参阅 Jared Beck 对此问题的回答:Rails 2.3-style plugins and deprecation warnings running task in Heroku

    上面 nzifab 提出的解决方案对潜在问题有效,但这不是问题标题中提出的问题

    【讨论】:

    • 如果您认为没有必要进一步点击。只需将gem 'rails_12factor' 放入您的GemFiles,在本地运行bundle installgit commit -m "Fix for heroku deprecating warning on-compile" 最后git push heroku master
    【解决方案3】:

    我的感受是, 您必须对任何 gem 进行了一些更改,并复制了层次结构和“..app/vendor/plugins”文件夹中更改的文件。

    如果是这种情况,那么这只是一个警告,告诉您应该将插件复制到“lib”文件夹中。 当您在开发模式下启动 webrick 时,您一定也看到了同样的情况。

    【讨论】:

      猜你喜欢
      • 2012-02-23
      • 2012-12-01
      • 2012-09-26
      • 2011-10-03
      • 2023-03-25
      • 2011-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多