ruby-on-rails - 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)
解决方案
我修复它以删除 .gitignore 中的 public\packs 文件
推荐阅读
- python-3.x - 可视化多个时间线
- javascript - 没有用户交互Javascript的文件阅读器
- react-native - React Native Flex 项目对齐
- python - 删除所有观察值都相同的列会影响我的模型吗?
- clang - 将“c”函数参数映射到 .ll 原型的命名约定
- c++ - 五子棋获胜条件c ++使用指针和数组
- c# - 如何使用 C# 从 Azure 表存储中检索最新记录?
- r - 显示正极和负极的垂直图
- sql - 返回最新日期的文章,sql max(DATE)
- sql-server - SQL server 链接服务器到 PostgreSQL 查询转换的 TOP 子句未转换