Mastodon Upgrade to 4.2.0 Asset Compilation failed
Why
Here I was trying to be a good Mastodon admin and upgrade the version. I was coming from the 4.0.x branch.
I encountered the following issues and sharing the direct solution as I had to piece together a few different
methods from my searches and no one had a direct answer for this.
Issue 1
I was seeing this error while trying to bundle install
:
1 | Your bundle is locked to json-canonicalization (0.3.2) from rubygems repository https://rubygems.org/ or installed locally, but that version can no |
Issue 2
Also, this issue later while pre-compiling the web assets:
1 | mastodon@mastodon:~/live$ RAILS_ENV=production bundle exec rails assets:precompile |
How
Issue 1 Solution
If you are temporary moving to 4.2.0 instead of a higher version where it is fixed (at least in 4.2.5 it’s at 1.0.0),
you can move higher json-canonicalization
in your Gemfile.lock
:
When I moved it to 0.3.3
I was able to move forward with the upgrade, not sure if 1.0.0
works with < 4.2.5
.
1 | [...snip...] |
Issue 2 Solution
Turns out that this command was running out of memory. The base usage of my node is a little over 1G
.
So, when webpack was running, it was running out of memory over my 2G
limit. Upping my memory to 4G
solved the problem.
If you only see this:
1 | Compiling... |
and nothing else, it’s probably a red-herring. This is a deprecation warning… just a shame it’s directly under
the heading of Compilation Failed:
.