Installing mysql2 gem errors on Apple silicon M1, M2 or M3 Mac running macOS Sonoma.
Make sure mysql-client, openssl and zstd are installed on Mac via Homebrew.
Replace
mysql-clientwith whichever mysql package you are using
| # Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90 | |
| # Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6 | |
| namespace :db do | |
| desc 'Dumps the database to backups' | |
| task dump: :environment do | |
| dump_fmt = ensure_format(ENV['format']) | |
| dump_sfx = suffix_for_format(dump_fmt) | |
| backup_dir = backup_directory(Rails.env, create: true) | |
| full_path = nil | |
| cmd = nil |
You may run into probelms like this:
Building native extensions. This could take a while...
ERROR: Error installing maxmind_geoip2:
ERROR: Failed to build gem native extension.
current directory: /Users/leonardteo/.rvm/gems/ruby-2.1.6@artstation/gems/maxmind_geoip2-0.0.8/ext/maxmind_geoip2
/Users/leonardteo/.rvm/rubies/ruby-2.1.6/bin/ruby -r ./siteconf20161227-1647-1c4uejw.rb extconf.rb
checking for maxminddb.h... no
| { | |
| "$schema": "http://json-schema.org/draft-04/schema#", | |
| "title": "JSON API Schema", | |
| "description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org", | |
| "x-oneOf": [ | |
| { | |
| "$ref": "#/definitions/success" | |
| }, | |
| { | |
| "$ref": "#/definitions/failure" |
| # See https://codeship.com/documentation/docker/browser-testing/ | |
| FROM myapp:base | |
| # We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver | |
| RUN apt-get install -y wget xvfb unzip | |
| # Set up the Chrome PPA | |
| RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | |
| RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list |
| en: | |
| i18n: | |
| transliterate: | |
| rule: | |
| а: a | |
| б: b | |
| в: v | |
| г: g | |
| д: d | |
| е: e |
For those out there more advanced, this is probably not worth reading. However, if you’re fairly new to system admin on a Digital Ocean Ubuntu/Nginx/Unicorn/MySQL/Ruby on Rails setup, it may help you out. Recently, I needed to upgrade my ruby version from 2.0.0-p353 to version 2.2.0 on my Digital Ocean droplet. I felt like this would be fairly easy to do since RVM comes installed with the ‘Ruby on Rails on 14.04 (Unicorn + Nginx)’ image that Digital Ocean provides under the ‘Applications’ tab when creating a Droplet.
While it is true that installing a new version of ruby using RVM on your system is fairly easy, there’s a few locations that you MUST change in order to use the new ruby version. This is where if you are unfamiliar or new to this, you could spend a decent amount of time digging for these. Hopefully this will save you the time and make your upgrade fairly smooth.
Let’s get started!
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>comment</key> | |
| <string> | |
| TODO: unresolved issues | |
| text: |
| function RGBAtoRGB(r, g, b, a, r2,g2,b2){ | |
| var r3 = Math.round(((1 - a) * r2) + (a * r)) | |
| var g3 = Math.round(((1 - a) * g2) + (a * g)) | |
| var b3 = Math.round(((1 - a) * b2) + (a * b)) | |
| return "rgb("+r3+","+g3+","+b3+")"; | |
| } | |
| $("#result").html(RGBAtoRGB(225,110,0,0.5,255,255,255)); | |
| |