无法加载任何页面。 Webpacker到Heroku App的Rails应用崩溃

时间:2018-10-03 00:20:20

标签: ruby-on-rails heroku deployment production-environment webpacker

在将webpacker添加到我的应用程序之前,heroku中的生产环境运行良好。添加webpacker的那一刻,我开始遇到这个问题。

我到处搜索此问题,并尝试删除/ public / packs,但这些解决方案无效。我在尝试使用webpacker访问heroku时遇到问题。我设法部署了该应用程序,当我尝试加载我的应用程序主页索引页面(或应用程序中的任何其他页面)时,出现了问题。我所拥有的只是我的heroku日志中的此信息,当我尝试发出GET请求时失败。我是否缺少配置?

我正在使用Rails 5.1,webpacker和Yarn。

我的应用的网址为http://semanticworkflow-api.herokuapp.com/

这是我的应用日志:

2018-10-03T00:07:12.951011+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=semanticworkflow-api.herokuapp.com request_id=2623c8c8-0cff-46cc-be81-7c0b28d3fd90 fwd="191.176.29.243" dyno= connect= service= status=503 bytes= protocol=https
2018-10-03T00:07:13.474152+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=semanticworkflow-api.herokuapp.com request_id=1524e5ad-1bfd-4dfa-b596-4e1c60545903 fwd="191.176.29.243" dyno= connect= service= status=503 bytes= protocol=https

这是我的gitignore文件:

# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
#   git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore Byebug command history file.
.byebug_history

/public/packs-test
/public/uploads
/node_modules
authorized_keys

webpacker.yml文件(更新):

# Note: You must restart bin/webpack-dev-server for changes to take effect

default: &default
  source_path: app/javascript
  source_entry_path: packs
  public_output_path: packs
  cache_path: tmp/cache/webpacker

  # Additional paths webpack should lookup modules
  # ['app/assets', 'engine/foo/app/assets']
  resolved_paths: ['app/javascript/src']

  # Reload manifest.json on all requests so we reload latest compiled packs
  cache_manifest: false

  extensions:
    - .coffee
    - .erb
    - .js
    - .jsx
    - .ts
    - .vue
    - .sass
    - .scss
    - .css
    - .png
    - .svg
    - .gif
    - .jpeg
    - .jpg

development:
  <<: *default
  compile: true

  dev_server:
    host: localhost
    port: 3035
    hmr: false
    https: false

test:
  <<: *default
  compile: true

  # Compile test packs to a separate directory
  public_output_path: packs-test

production:
  <<: *default

  # Production demands on precompilation of packs prior to booting for performance.
  compile: false

  # Cache manifest.json for performance
  cache_manifest: true

0 个答案:

没有答案