首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Webpacker找不到静态资产

Webpacker找不到静态资产
EN

Server Fault用户
提问于 2022-11-13 19:00:04
回答 1查看 564关注 0票数 2

我用数字海洋预配置液滴创建了一个Mastodon实例,它在Ubuntu20.04上部署了Mastodon的5.3.5版本。我运行了安装向导,然后立即使用官方指示将其升级为Mastodon的C1

重新启动后,web就会关闭。日志/var/log/syslog包含:

代码语言:javascript
复制
ActionView::Template::Error (Webpacker can't find media/icons/favicon-16x16.png in /home/mastodon/live/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:

然后是清单JSON的长列表。

下面有几件事情没有解决这个问题:

代码语言:javascript
复制
echo RAILS_SERVE_STATIC_FILES=true >> /home/mastodon/live/.env.production
RAILS_ENV=production bundle exec rails assets:precompile

使用find,我找到了日志说找不到的文件。在./app/javascript/icons/favicon-16x16.png

所以文件似乎放错地方了?或者这是权限问题?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2022-12-26 22:38:09

为了回答我自己的问题,我使用的DigitalOcean液滴似乎没有足够的内存来执行升级。我有2GB的内存,但4GB是需要的。

这些说明(我在这里复制从GitHub上的masukomi)是为我工作的:

  • 关掉你的水滴,当然,这会防止任何人访问你的盒子。
  • 将液滴大小调整为4GB RAM (只做CPU + RAM以便您可以返回)
  • 把水滴打开
  • ssh返回到机器( IP不应该更改)
代码语言:javascript
复制
su - mastodon
cd ~/live

# probably unnecessary but won't hurt...
git checkout yarn.lock

# clobber the precompiled assets because it probably thinks everything's fine with them
RAILS_ENV=production bundle exec rails assets:clobber
RAILS_ENV=production bundle exec rails assets:precompile

# switch back to the root user
exit

# restart all the mastodon services
systemctl restart mastodon-sidekiq
systemctl reload mastodon-web
# probably unnecessary but won't hurt...
systemctl restart mastodon-streaming

最后,masukomi指出,您可以将液滴切换回以前使用的较小的RAM大小。感谢Jannik S.为我指出了这个答案。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1115576

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档