1

我正在努力将我的 Rails 6 应用程序部署到 Heroku - 部署因以下错误消息而中断:

remote:        rake aborted!
remote:        Sprockets::FileNotFound: couldn't find file 'jquery-ui' with type 'text/scss'
remote:        Checked in these paths:
remote:          /tmp/build_510d92ed/app/assets/config
remote:          /tmp/build_510d92ed/app/assets/images
remote:          /tmp/build_510d92ed/app/assets/javascripts
remote:          /tmp/build_510d92ed/app/assets/stylesheets

这是我的app/assets/config/manifest.js

//= link_tree ../images
//= link_directory ../javascripts .js
//= link application.scss
//= link custom.css
//= link vendor/slick.min.js

并且是app/assets/stylesheets/application.scss文件:

/*
 *= require_self
 *= require jquery-ui
 */
 @import 'custom';

package.json

{
  "name": "myapp",
  "private": true,
  "dependencies": {
    "@hotwired/turbo-rails": "^7.0.0-beta.5",
    "@rails/actioncable": "^6.0.0",
    "@rails/activestorage": "^6.0.0",
    "@rails/ujs": "^6.0.0",
    "@rails/webpacker": "5.2.1",
    "@tailwindcss/forms": "^0.3.2",
    "@tailwindcss/postcss7-compat": "^2.0.4",
    "autoprefixer": "^9",
    "el-transition": "^0.0.7",
    "google-maps": "^4.3.3",
    "jquery": "^3.6.0",
    "postcss": "^7",
    "stimulus": "^2.0.0",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat"
  },
  "version": "0.1.0",
  "devDependencies": {
    "webpack-dev-server": "^3.11.2"
  }
}

我该如何解决这个问题?

先感谢您。

4

2 回答 2

0

我的解决方案是运行yarn install. 有时是小事。

于 2021-08-25T17:18:27.833 回答
0

对我来说,升级到 rails 7 后,我需要添加链轮,就像这样,然后一切正常:

# Gemfile
gem "sprockets-rails"

更多在这里

于 2022-01-24T12:52:56.420 回答