【问题标题】:Troubleshooting rails 6, bootstrap 4, webpacker on heroku疑难解答 rails 6、bootstrap 4、heroku 上的 webpacker
【发布时间】:2019-04-16 19:13:23
【问题描述】:

Heroku 部署失败。所以我试着在本地做同样的问题。

$ NODE_ENV=production RAILS_ENV=production rails assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke yarn:install (first_time)
** Execute yarn:install
yarn install v1.13.0
[1/4] ????  Resolving packages...
[2/4] ????  Fetching packages...
[3/4] ????  Linking dependencies...
warning " > webpack-dev-server@3.3.1" has unmet peer dependency "webpack@^4.0.0".
warning "webpack-dev-server > webpack-dev-middleware@3.6.2" has unmet peer dependency "webpack@^4.0.0".
[4/4] ????  Building fresh packages...
✨  Done in 7.99s.
** Execute assets:precompile
I, [2019-04-16T12:10:11.016887 #96897]  INFO -- : Writing /private/tmp/template-a32b218/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
I, [2019-04-16T12:10:11.017485 #96897]  INFO -- : Writing /private/tmp/template-a32b218/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz
** Invoke webpacker:compile (first_time)
** Invoke webpacker:verify_install (first_time)
** Invoke webpacker:check_node (first_time)
** Execute webpacker:check_node
** Invoke webpacker:check_yarn (first_time)
** Execute webpacker:check_yarn
** Invoke webpacker:check_binstubs (first_time)
** Execute webpacker:check_binstubs
** Execute webpacker:verify_install
** Invoke environment 
** Execute webpacker:compile
Compiling…
Compilation failed:

$ echo $?
1

【问题讨论】:

    标签: heroku webpacker ruby-on-rails-6


    【解决方案1】:

    如果您在应用程序中实际使用包之前忘记执行“添加纱线”操作,Webpacker 可能会静默挂起。

    【讨论】:

    • 他们现在可能已经修好了
    【解决方案2】:

    找到我自己问题的答案。

    config/webpacker.yml 中,有一个布尔选项可以使输出更加详细。它告诉我,我的一个包含语句中有一个错字。

    【讨论】:

    • 你使用了什么设置?我也有类似的问题。
    • 我现在忘记了,但我想我在官方 web packer 文档中发现了它
    • @Cimm,将 webpack_compile_output 设置为 true
    猜你喜欢
    • 1970-01-01
    • 2016-06-15
    • 2011-06-21
    • 2013-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-06
    • 2014-08-29
    相关资源
    最近更新 更多