Heroku 应用程序因包含模块而崩溃

发布于 2024-10-24 16:01:45 字数 12592 浏览 1 评论 0原文

因此,我在开发和生产环境中本地测试了我的应用程序,一切似乎都工作正常,直到我推送到 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 [email protected]
    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 文件
  • 在我的 production.rb 文件中设置 config.serve_static_assets = true 因为我的一些 css 和 javascript 没有正确发送
  • 确保运行 heroku rake db:migrate
  • 确保我将最新版本从 git 推送到 heroku

基本上我已经没有想法了,我真的很想解决这个问题,任何帮助将不胜感激。谢谢你!

So I've tested my application locally in both Development and Production environments and everything seems to be working fine until I push to Heroku. When I check the logs on Heroku, I get the following:

    2011-03-21T22:37:42-07:00 heroku[slugc]: Slug compilation started
    2011-03-21T22:38:43-07:00 heroku[api]: Deploy f9bb672 by [email protected]
    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

I'm assuming that it is because I'm trying to include a module that I created in my /lib directory called Utils.

In my controller I do the following:

   include Utils

The filename is Utils.rb and the structure of the module is:

    module Utils
        def some_function
        end
    end

Not sure what the issue may be, but I've taken the following steps:

  • Adding config.autoload_paths += %W(#{config.root}/lib) to my application.rb file
  • Setting config.serve_static_assets = true in my production.rb file since some of my css and javascript wasn't being sent correctly
  • Making sure of running heroku rake db:migrate
  • Making sure I pushed the latest version from git to heroku

Basically I'm running out of ideas and I really would love to solve this issue, any help would be greatly appreciated. Thank You!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子是时光的心 2024-10-31 16:01:45

请确保文件名是 utils.rb 而不是 Utils.rb

Please make sure that the filename is utils.rb instead of Utils.rb.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文