Dokku:远程应用程序容器无法启动

问题描述 投票:0回答:1

我有一个使用Rails 5.0.0构建的应用程序。我可以正常地将应用程序部署到Heroku,而不会出错。我使用Ubuntu 16.04 LTS配置了Lightsail,并安装了dokku。该应用程序已经在另一台亚马逊服务器(带有Ubuntu 16.04 LTS的EC2)上运行,但是在该服务器上的部署过程很奇怪,这就是为什么我将其更改为另一台具有dokku的服务器。当我运行git push dokku时,该过程开始了,但是最后却出现了下面的错误。

CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
d09da8aad3ecbd6b62b189bd74b3d35c9d1b11c4a4a06e6a063687b7e4ae60fb
remote: App container failed to start!!
=====> 99aulas web container output:
       => Booting Puma
       => Rails 5.0.7.2 application starting in production on http://0.0.0.0:5000
       => Run `rails server -h` for more startup options
       /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concern.rb:126:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
        from /app/app/models/models/concerns/productable.rb:5:in `<module:Productable>'
        from /app/app/models/models/concerns/productable.rb:1:in `<top (required)>'

但是此代码已经在另外两台服务器上运行,没有相同的错误。在日志中提到的文件中,我有以下代码:

可生产模型的型号

extend ActiveSupport::Concern

included do

    extend FriendlyId
    include PgSearch

    before_validation :update_slug, on: :update, prepend: true

    acts_as_paranoid

    has_one :highlight, as: :highlightable, dependent: :destroy

    scope :published, -> { joins(:teacher).where(status: PublishStatus::PUBLIC) }
    scope :draft, -> { where(status: PublishStatus::DRAFT) }
    scope :from_category_group, -> category_group { joins(category: :category_group).where("category_groups.slug = ?", category_group) }
    scope :from_category, -> category { joins(:category).where("categories.slug = ?", category) }
    scope :from_teacher, -> teacher_id { where(teacher_id: teacher_id) }        
    scope :highlighted, -> { joins(:highlight) } 

    pg_search_scope :search, 
        associated_against: {
            category_group: :name,
            category: :name,
            teacher: :name
        }, 
        against: [:title, :description, :keywords],
        ignoring: :accents,
        using: {
            tsearch: { prefix: true }
        }

end

def update_slug
    #force update slug only if title changed
    self.slug = nil if self.title_changed?          
end

结束

有人知道这可能是什么吗?

谢谢!

ruby-on-rails heroku ruby-on-rails-5 dokku amazon-lightsail
1个回答
0
投票

我一直在阅读您的问题以及所附评论中的问题,这非常令人困惑。完成一些阅读后,我想知道这是否与bootsnap有关。如果您正在运行bootsnap,可以尝试在没有它的情况下运行rails容器吗?我看到一些证据似乎指向bootsnap通过切换load_path_cache和/或autoload_paths_cache来解决此问题的人。

参见:https://github.com/Shopify/bootsnap/issues/75

© www.soinside.com 2019 - 2024. All rights reserved.