【问题标题】:Failed to deploy ruby app to heroku "Precompling assets failed"无法将 ruby​​ 应用程序部署到 heroku “预编译资产失败”
【发布时间】:2023-03-06 13:54:01
【问题描述】:

我尝试使用 Bitbucket 将 Rails 应用程序部署到 Heroku,但是它显示我的 ruby​​ 应用程序无法编译的错误。

我按照本文中的说明进行操作。 Auto-Deployment Using Bitbucket and Heroku

我的pipeline.yml 文件如下所示:

image: ruby:2.4.0
clone:
  depth: full
pipelines:
  default:
    - step:
        # set HEROKU_API_KEY and HEROKU_APP_NAME environment variables
        # set clone `depth: full' as described here: https://confluence.atlassian.com/x/Y9-5Mw
        name: Deploy to Heroku
        deployment: test   # set to test, staging or production
        # trigger: manual  # uncomment to have a manual step
        script:
          - git push https://heroku:$HerokuAPI@git.heroku.com/$HerokuName.git HEAD

definitions:
  caches:
    bundler: ./vendor

【问题讨论】:

  • 在 production.rb 中,设置config.assets_precompile: true
  • 我已经试过了,还是不行,同样的错误
  • 执行 "RAILS_ENV=production rake assets:precompile" 然后尝试推送代码
  • 这可能对你有帮助https://devcenter.heroku.com/articles/rails-4-asset-pipeline

标签: ruby-on-rails ruby heroku bitbucket web-deployment


【解决方案1】:

我遇到了同样的错误,当我删除公共文件夹时,然后是 $rake assets:precompile 然后是 $git add -A $git commit -m "commit" $git push heroku master

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-28
    • 2021-04-06
    • 1970-01-01
    • 2014-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多