ruby-on-rails – 未初始化的常量RAILS_DEFAULT_LOGGER

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 未初始化的常量RAILS_DEFAULT_LOGGER前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试在redmine,mylyn中安装一个插件.

我收到以下错误

uninitialized constant RAILS_DEFAULT_LOGGER

    0   /home/redmine/plugins/redmine-plugin/init.rb    3   
    1   /home/redmine/lib/redmine/plugin.rb     129     in `load'
    2   /home/redmine/lib/redmine/plugin.rb     120     in `each'
    3   /home/redmine/lib/redmine/plugin.rb     120     in `load'
    4   /home/redmine/config/initializers/30-redmine.rb     13  
    5   /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/engine.rb    588     
    6   /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/engine.rb    587     in `each'
    7   /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/engine.rb    587     
    8   /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb     30  in `instance_exec'
    9   /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb     30  in `run'
    10  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb     55  in `run_initializers'
    11  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb     54  in `each'
    12  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb     54  in `run_initializers'
    13  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/application.rb   136     in `initialize!'
    14  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb  30  in `send'
    15  /usr/lib64/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb  30  in `method_missing'
    16  /home/redmine/config/environment.rb     19  
    17  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb     222     in `require'
    18  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb     222     in `preload_application'
    19  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb     181     in `initialize_server'
    20  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/utils.rb     572     in `report_app_init_status'
    21  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb     174     in `initialize_server'
    22  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb   204     in `start_synchronously'
    23  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb   180     in `start'
    24  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb     149     in `start'
    25  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb     219     in `spawn_rails_application'
    26  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb    132     in `lookup_or_add'
    27  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb     214     in `spawn_rails_application'
    28  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb    82  in `synchronize'
    29  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb    79  in `synchronize'
    30  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb     213     in `spawn_rails_application'
    31  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb     132     in `spawn_application'
    32  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb     275     in `handle_spawn_application'
    33  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb   357     in `__send__'
    34  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb   357     in `server_main_loop'
    35  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb   206     in `start_synchronously'
    36  /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/helper-scripts/passenger-spawn-server  99

这个常数已被弃用?
如何更换?

解决方法

未来的注释:RAILS_DEFAULT_LOGGER已在3.x版本中弃用.

现在你可以使用:

Rails.logger.info
原文链接:https://www.f2er.com/ruby/269266.html

猜你在找的Ruby相关文章