Reputation: 391
What happened to mimemagic? @rails activerecord depends on @basecamp marcel which depends on mimemagic 0.3.2. Now that mimemagic 0.3.2 has been yanked, what is the way forward?
Upvotes: 15
Views: 13658
Reputation: 9927
You can get the gem back. The gem binary built might have been removed but the commit ref of each release still there. You can ref to the gem with the github commit ref like this:
# 0.3.2
gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '3543363026121ee28d98dfce4cb6366980c055ee'
for other commit ref you can see this link:
https://github.com/mimemagicrb/mimemagic/commits/0.3?after=22c06826417ed67c02b94ebc9998c24da5a03c56+69&branch=0.3
Upvotes: 13
Reputation: 391
Rails team has posted a patch update that remove the mimemagic dependency. The Marcel library now uses Apache Tika, released under the permissive and compatible Apache License 2.0
Read more at: https://weblog.rubyonrails.org/2021/3/26/marcel-upgrade-releases/
Upvotes: 3
Reputation: 21
Please install shared-mime-info and add FREEDESKTOP_MIME_TYPES_PATH in your environment. if you use windows or linux, please download from https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/0440063a2e6823a4b1a6fb2f2af8350f/shared-mime-info-2.0.tar.xz and extract it
Upvotes: 1
Reputation: 806
Note: upgrading to Mimemagic 0.3.8 is still under GPL-2.0 license which may not be desirable under all circumstances.
I ran into this today and here's what I ended up doing to fix the issue
(I'm on a MBP Catalina 10.15.7)
Step 1: update Gemfile.lock to mimemagic 0.3.8 by running
$ brew install shared-mime-info
$ bundle update mimemagic
(Be sure the system you're deploying to has the proper libraries installed).
✅ Mimemagic issue solved thanks to this comment
Step 2: Upgrade yarn packages
when I did this, it updated everything in homebrew so when I went to restart my server, I received the
Your Yarn packages are out of date!
Please run `yarn install` to update.
but, running $yarn install
gave me the error:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.67.dylib
Referenced from: /usr/local/bin/node
and
yarn check v1.22.10
warning Integrity check: System parameters don't match
error Integrity check failed
error Found 1 errors.
Finally fixed yarn issues by running
$ yarn --update-checksums
🎉 Yarn Issue solved (thanks to this blog post )
Step 3 Last, brew also updated my Postgresql from 12 to 13.2 so I received the
PG::ConnectionBad - could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
No PID to remove, stopping and restarting, unloading and reloading, launch ctl didn't work... finally, this worked check postgres.log by running
$ tail -n 10 /usr/local/var/log/postgres.log
last line shows:
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.2.
🙌🏻 Fixed with:
$ brew postgresql-upgrade-database
Last, postgres db upgrade fixed thanks to this post
Upvotes: 9
Reputation: 391
Fixed this by just updating mimemagic
version to 0.3.6
my Gemfile.lock
Upvotes: 0
Reputation: 3999
The gem author has pulled all versions due the gem itself violating the GPL license requirements. Currently there's people working solutions to make a MIT compatible solution or to work around the dependencies.
Discussion: https://github.com/rails/rails/issues/41750
Upvotes: 3