首页 > 解决方案 > Heroku 不适用于 rails 6

问题描述

我正在使用 rails 6 将代码成功部署到 heroku,但 public/packs 没有部署。它负责发布表单页面中的添加标签选项。

应用程序.js

// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.

import "bootstrap"



require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")


require('./nested-forms/addFields')

// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

标签: ruby-on-railsheroku

解决方案


我修复它以删除 .gitignore 中的 public\packs 文件


推荐阅读