当我没有任何时候,供应商/插件的Rails弃用警告

时间:2012-10-04 23:17:29

标签: ruby-on-rails ruby-on-rails-3 heroku ruby-on-rails-3.2 rails-console

  

可能重复:
  eliminating Rails 2.3-style plugins and deprecation warnings

当我执行heroku run console时,我收到以下错误:

$ heroku run console
Running `console` attached to terminal... up, run.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 an d 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/config/environment.rb:5)

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 an d 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/config/environment.rb:5)

Connecting to database specified by DATABASE_URL
Loading production environment (Rails 3.2.8)
irb(main):001:0>

但是,我在vendor / plugins中的唯一文件是.gitkeep

$ ls -lha vendor/plugins/
total 0
drwxr-xr-x    1 Scott    Administ        0 Sep  7 12:26 .
drwxr-xr-x    1 Scott    Administ        0 Sep  7 12:26 ..
-rw-r--r--    1 Scott    Administ        0 Sep  7 12:26 .gitkeep

我甚至尝试删除.gitkeep文件,但仍然会收到相同的弃用警告。我有不好的插件吗?这是一个相对较新的Rails项目。

1 个答案:

答案 0 :(得分:8)

Heroku注入旧式插件,使您的应用程序在其服务器上运行(特别是将日志重定向到stdout,并从rails提供静态资产)。检查git push的输出......你会看到类似这样的内容

-----> Rails plugin injection
       Injecting rails_log_stdout
       Injecting rails3_serve_static_assets

所以这不是你做过的事情,也不用担心!这些在Rails 3.x上运行得很好,当Rails 4更成熟时,Heroku无疑会有所帮助。