Heroku: NoMethodError: неопределенный метод `timeout = 'для Rack :: Timeout: Class - PullRequest
0 голосов
/ 13 ноября 2018

Только что обновил приложение Rails 4.2 до 5.2.1 и не смог перенести его в Heroku.Ошибки ниже.Я попробовал то, что рекомендовано здесь и здесь , добавив следующее в мой инициализатор rack_timeout.rb.

Rails.application.config.middleware.insert_before Rack::Runtime, Rack::Timeout, service_timeout: 5

Но это не помогает.Мысли?

$ git push heroku
...
remote: -----> Installing node-v8.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        NoMethodError: undefined method `timeout=' for Rack::Timeout:Class
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/config/initializers/rack_timeout.rb:2:in `<top (required)>'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `block in load'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/engine.rb:657:in `block in load_config_initializer'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/engine.rb:656:in `load_config_initializer'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `each'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/engine.rb:613:in `block in <class:Engine>'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `each'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/config/environment.rb:5:in `<top (required)>'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/application.rb:337:in `require_environment!'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/railties-5.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/airbrake-7.4.0/lib/airbrake/rake.rb:17:in `execute'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/airbrake-7.4.0/lib/airbrake/rake.rb:17:in `execute'
remote:        /tmp/build_c66056b406a6fcdc37b9dde3124992ce/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed

1 Ответ

0 голосов
/ 13 ноября 2018

В config/initializers/rack_timeout.rb в строке 2 вы делаете Rack::Timeout.timeout =

Этот метод больше не существует в самых последних версиях времени ожидания в стойке. После того как вы обновились, вам также необходимо изменить код.

В файле readme для тайм-аута указано, как настроить время ожидания в стойке с помощью приложения rails: https://github.com/heroku/rack-timeout#rails-apps-manually

...