【发布时间】: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