Fix: eventmachine gem failed to build on macOS Ventura with Ruby 2.7.6
source link: https://www.jessesquires.com/blog/2023/01/18/eventmachine-failure-on-macos-ventura/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Fix: eventmachine gem failed to build on macOS Ventura with Ruby 2.7.6
18 January 2023
After upgrading to macOS Ventura, I decided to upgrade my Ruby version and ran into issues trying to build my site locally.
As I’ve written before, I use Jekyll to build this site and I host with NearlyFreeSpeech. I was upgrading to Ruby 2.7.6, which I realize is old and near its end of life. However, this is the version installed on NearlyFreeSpeech and I need my local environment to match that. Because of how NearlyFreeSpeech operates, I cannot upgrade Ruby on my server on my own. Instead, I must wait for the sysadmins to perform upgrades. It’s not ideal, but I rarely have issues. Overall their service is stable and inexpensive, so I have no complaints.
Anyway, installing a new version of Ruby on my Mac meant I needed to perform a fresh bundle install
, and that’s where the trouble started. Most of the time this “just works” because I’m diligent about staying up-to-date. However, my bundle install
failed with the following error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/var/rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7/ext
/usr/local/var/rbenv/versions/2.7.6/bin/ruby -I /usr/local/var/rbenv/versions/2.7.6/lib/ruby/site_ruby/2.7.0 extconf.rb
[....]
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
In Gemfile:
jekyll-archives was resolved to 2.2.1, which depends on
jekyll was resolved to 4.3.1, which depends on
em-websocket was resolved to 0.5.3, which depends on
eventmachine
A transitive dependency from Jekyll, eventmachine
1.2.7, failed to install because it could not build native extensions. These problems are no fun to debug, especially because I am not a Ruby expert. Luckily, after some searching online, I found a solution here. If you also run into this problem, you need to install eventmachine
with the following flags:
gem install eventmachine -v '1.2.7' -- --with-ldflags="-Wl,-undefined,dynamic_lookup"
After this, bundle install
succeeded!
Recommend
-
2
Audio player loading… At WWDC 2022, Apple announced macOS 13 Ventura, its...
-
8
Next Up The Transformation Of The iPhone From 2007 To 2022
-
6
WWDC 2022 — Apple announces macOS 13 Ventura, the next major software update for the Mac The new macOS includes updated apps and some multitasking enhancements....
-
11
Top Rated CommentsRealityck5 hours ago at 01:26 pmmacOS 13 beta (22A5266r)[SPOILER="macOS 13 Ventura Beta Release Not...
-
2
Apple Introduces macOS Ventura: First Look at New FeaturesApple Introduces macOS Ventura: First Look at New FeaturesMonday June 6, 2022 11:18 am PDT by
-
6
Apple macOS Ventura: The Biggest Features Coming To Mac ...
-
4
macOS Ventura Drops Support for Older Macs, Works With 2017 and Later MachinesMonday June 6, 2022 12:19 pm PDT by Juli Clover
-
4
Apple Says Public Betas of iOS 16, macOS Ventura, and More Available in JulyMonday June 6, 2022 11:34 am PDT by Joe Rossignol...
-
0
Apple rolling out updated RC build of macOS Ventura 13.4 ahead of official release
-
3
Installing old ruby on Venturaback in timePublished June 28, 2023Contents...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK