Сбой приложения Heroku с включением модуля - PullRequest
1 голос
/ 22 марта 2011

Итак, я протестировал свое приложение локально в средах разработки и производства, и, кажется, все работало нормально, пока я не перешел на Heroku.Когда я проверяю логи Heroku, я получаю следующее:

    2011-03-21T22:37:42-07:00 heroku[slugc]: Slug compilation started
    2011-03-21T22:38:43-07:00 heroku[api]: Deploy f9bb672 by some.email@gmail.com
    2011-03-21T22:38:43-07:00 heroku[web.1]: State changed from created to starting
    2011-03-21T22:38:43-07:00 heroku[slugc]: Slug compilation finished
    2011-03-21T22:38:46-07:00 app[web.1]: /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/app/controllers/songs_controller.rb:2: uninitialized constant SongsController::Utils (NameError)
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/config/environment.rb:5
    2011-03-21T22:38:46-07:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    2011-03-21T22:38:46-07:00 app[web.1]:   from config.ru:3
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /app/64e16569-bd45-4a40-b4af-ff9a339c1ef1/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
    2011-03-21T22:38:46-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
    2011-03-21T22:38:46-07:00 heroku[web.1]: State changed from starting to crashed
    2011-03-21T22:38:46-07:00 heroku[web.1]: State changed from crashed to created
    2011-03-21T22:38:47-07:00 heroku[web.1]: State changed from created to starting
    2011-03-21T22:38:49-07:00 app[web.1]: /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/app/controllers/songs_controller.rb:2: uninitialized constant SongsController::Utils (NameError)
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/config/environment.rb:5
    2011-03-21T22:38:49-07:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    2011-03-21T22:38:49-07:00 app[web.1]:   from config.ru:3
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /app/4a26714e-2049-432b-9d67-c77edfe3c07c/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
    2011-03-21T22:38:49-07:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
    2011-03-21T22:38:50-07:00 heroku[web.1]: State changed from starting to crashed
    2011-03-21T22:39:00-07:00 heroku[rake.1]: State changed from created to starting
    2011-03-21T22:39:06-07:00 heroku[rake.1]: State changed from starting to complete
    2011-03-21T22:39:10-07:00 heroku[router]: Error H10 (App crashed) -> GET blazing-dawn-282.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
    2011-03-21T22:39:10-07:00 heroku[nginx]: GET / HTTP/1.1 | 173.51.104.168 | 796 | http | 503
    2011-03-21T22:39:10-07:00 heroku[router]: Error H10 (App crashed) -> GET blazing-dawn-282.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
    2011-03-21T22:39:10-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 173.51.104.168 | 795 | http | 503

Я предполагаю, что это потому, что я пытаюсь включить модуль, который я создал, в каталог / lib с именем Utils.

В моем контроллере я делаю следующее:

   include Utils

Имя файла - Utils.rb, а структура модуля:

    module Utils
        def some_function
        end
    end

Не знаю, в чем проблемаможет быть, но я предпринял следующие шаги:

  • Добавление config.autoload_paths + =% W (# {config.root} / lib) в мой файл application.rb
  • Настройка config.serve_static_assets = true в моем файле production.rb, так как некоторые из моих css и javascript отправлялись неправильнопротолкнул последнюю версию с git на heroku

В принципе у меня заканчиваются идеи, и я очень хотел бы решить эту проблему, любая помощь будет принята с благодарностью.Спасибо!

1 Ответ

1 голос
/ 22 марта 2011

Пожалуйста, убедитесь, что имя файла utils.rb вместо Utils.rb .

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...