Where It All Started.

Where It All Started.

Life, Stock Trading, Investments, Business and Startup. Most are programming stuff.

Installing MySQL2 Ruby Gem in macOS Mojave

Installing MySQL2 gem became a common problem for people who uses macOS to develop Ruby1 based apps that utilized MySQL2 data store. I’ve personally encountered this problem myself back in the days and still encountering this on brand new setup macOS workstation. In this article, we will go through the steps I did to resolved this problem.

Tradition lives because young people come along who catch its romance and add new glories to it.

— Michael Novak.

Prerequisites

We assume here you have some basic knowledge on setting up Ruby and command line tools on macOS.

  • Ruby (Latest)
  • Bundler3 (Latest)
  • Homebrew4 (Installed and no problems, run and check brew doctor for more info and if the installation is okay)

What did I do to solve the problem?

Here’s what I’ve done to resolve the problem.

  1. First is to install openssl or gnutls (choose your poison). Both are great have some pros and cons but most people would use openssl and that’s what I preferred. brew install openssl
  2. Then we point mysql2 dependency to the installed openssl package from Homebrew. bundle config --global build.mysql2 --with-opt="$(brew --prefix openssl)"
  3. After all of that, we install the mysql2 dependency and all the sub-dependents that are needed. bundle install

That’s all needed in order to install mysql2 on a fresh macOS Mojave. Now you can develop ruby app that utilize MySQL as data store.

So guys, let me know if you encountered any problems? or any particular additional ways to install mysql2. That’s it guys hope you enjoyed this article and as always live life.

😀😁😁🤣😃😄


  1. Ruby is an interpreted, high-level, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro “Matz” Matsumoto in Japan. Ruby is dynamically typed and uses garbage collection. ↩︎
  2. MySQL is an open-source relational database management system. Its name is a combination of “My”, the name of co-founder Michael Widenius’s daughter, and “SQL”, the abbreviation for Structured Query Language. ↩︎
  3. Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. ↩︎
  4. Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system and Linux. The name is intended to suggest the idea of building software on the Mac depending on the user’s taste. ↩︎

Popular Posts

  • Bitcoin (BTC) Still Bullish According To BlockTower
    The continuous Bitcoin volatility, according to BlockTower Capital’s general partner Michael Bucella, should not come as a surprise because it is part of the asset’s development trajectory. Bucella told CNBC […]
  • Major Firm BlackRock To Create It’s Own Blockchain ETF
    According to a filing with the US Securities and Exchange Commission on Jan. 21, BlackRock Inc., the world’s largest asset management business, has applied for an exchange-traded fund (ETF) that […]
  • Google Going Crypto
    As the firm looks to provide a wider range of financial services, including cryptocurrencies, Google has hired veteran PayPal CEO Arnold Goldberg to manage its payments division. Google’s action comes […]
  • Total Crypto Market Cap Will Reach 5 Trillion USD In 2022 According To AvaLabs CEO
    In 2022, John Wu, the CEO of Ava Labs, a blockchain business that creates the software for the Avalanche (AVAX) blockchain, offered a lot of fascinating forecasts for the cryptocurrency […]
  • Pavia Metaverse Project Debuts On Cardano (ADA)
    The Metaverse is currently in its early stages. While Ethereum-based metaverse games like The Sandbox have exploded in popularity, investors are also interested in developing applications on secure PoS networks […]

Leave a Reply

Your email address will not be published. Required fields are marked *