When performing a bundle install for a Rails 6.1.3 + Ruby 3.0.0 on macOS Catalina or Big Sur, you may run into the following error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Ensure you have either installed the shared-mime-info package for your distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location
of that file.
This gem might be installed as a dependency of some bigger package, such as rails, activestorage,
axlsx or cucumber. While most of these packages use the functionality of this gem, some gems have
included this gem by accident. Set USE_FREEDESKTOP_PLACEHOLDER=true if you are certain that you
do not need this gem, and wish to skip the inclusion of freedesktop.org.xml.
The FREEDESKTOP_PLACEHOLDER option is meant as a transitional feature, and will be deprecated in
the next release.
If this happens, you will need to install the shared-mime-info package for macOS.
> brew install shared-mime-info
If the preceding command fails, it is most likely due to some missing Xcode dev tools that need to be installed so the package can be properly compiled for your distribution of macOS. The error messages you receive will tell you exactly the Xcode dev tools that need to be installed as well as the command to execute to make it happen.
Better yet, if you can, upgrade your Rails project to version 188.8.131.52 or higher, as the 0.0.0.1 revision was created to fix the shared-mime-info defect caused by the mimemagic gem.
After installing macOS Big Sur, you may run into issues getting Flutter set back up for development. Due to the security enhancements added to Catalina and increased in Big Sur, you may run into macOS blocking the execution of some development tools like Flutter and Dart.
If you run into the error message: “dart” can’t be opened because Apple cannot check it for malicious software.
You simply need to:
Open system preferences/Security & Privacy/General
Unlock by clicking the clock in the bottom left and enter your admin password
Where it has the warning that “dart” was blocked, click “allow anyway”
If you run into trouble installing Rmagick on Ubuntu, it is most likely because you do not have the dev libraries installed that are needed by the rmagick Ruby Gem. Run the following commands in your terminal and everything should work fine.
If you are getting a build error from Gem when trying to install the PostgreSQL gem called ‘pg’ and you are using the PostgreSQL App instead of installing PostgreSQL via Brew or some other method, it is because Gem cannot find the PostgreSQL config in the standard locations. To correct this you need to provide Gem with the path to the config file stored within the PostgreSQL App’s internal folder structure.
Note: the latest version of the PostgreSQL App, at the time of this writing was 9.4, your version may be different. Make sure you change the 9.4 in the config path in the command above to the one you are using or it will not work. You can verify the path by opening Finder, going to the Applications folder, locating Postgres.app, right clicking and selecting ‘show package contents’. This will open up the app’s folder structure in Finder.