Friedrich Ewald My Personal Website

Installing and building eventmachine

Installing eventmachine on a new or updated Mac OS can have some challenges. I recently had to reinstall Jekyll after upgrading my personal computer with the latest Mac OS Sequoia. Running bundle install failed with the following error message:

An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.

In Gemfile:
  jekyll-compose was resolved to 0.12.0, which depends on
    jekyll was resolved to 4.3.3, which depends on
      em-websocket was resolved to 0.5.3, which depends on
        eventmachine
The root cause in my case was a broken installation of Ruby due to the XCode Command Line Tools being broken after the upgrade. The following commands fixed it for me: The .tool-versions file should look similar to this:
ruby 3.3.6
Then execute the following lines to reinstall the XCode command line tools, Ruby and finally all dependencies, including eventmachine:
# Remove Ruby
asdf uninstall ruby

# Remove command line tools
sudo rm -rf /Library/Developer/CommandLineTools

# Reinstall command line tools
xcode-select --install

# Reinstall ruby
asdf install ruby

# Validate
ruby -rrbconfig -e 'puts RbConfig::CONFIG["CXX"]' # correctly prints "clang++", "false" otherwise

# Install dependencies, includuing eventmachine
bundle install
This is one of the reasons why I very much like single executables that can run standalone, for example created by Go. Once they’re built for a specific OS they don’t need to be rebuilt. Since this website is created in Jekyll which is Ruby based, I don’t have that luxury.


About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.