What happened to mimemagic?

Viewed 9862

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?

7 Answers

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

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

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

hard coded gem reference for a workaround here

Fixed this by just updating mimemagic version to 0.3.6 my Gemfile.lock

Related