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

时间:2019-05-31 13:29:19

标签: ruby-on-rails heroku ruby-on-rails-5 dokku amazon-lightsail

我有一个使用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

结束

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

谢谢!

1 个答案:

答案 0 :(得分:0)

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

请参阅:https://github.com/Shopify/bootsnap/issues/75