Project

General

Profile

Actions

Bug #21510

closed

Rails server crashes on Mac M2 with Bus Error at 0x0000000109946aac

Added by jkvithanage (Janaka Vithanage) 2 days ago. Updated 2 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin24]
[ruby-core:122731]

Description

I have been struggling to setup a Rails 5.1.7 application on my Macbook M2 for months.
I installed Rosetta, x86_64 brew and my terminal app is set to run with Rosetta.

~ ❯ arch
i386
~ ❯ which brew
/usr/local/bin/brew
~ ❯ brew list           
==> Formulae
abseil			coreutils		icu4c@77		lz4			pkgconf			xz
autoconf		gdbm			krb5			m4			postgresql@14		yarn
automake		gettext			libffi			mysql			protobuf@29		zlib
bison			gh			libnghttp2		node			readline		zstd
brotli			git			libtool			node-build		redis
c-ares			glib			libunistring		nodenv			ruby-install
ca-certificates		gmp			libuv			openssl@3		shared-mime-info
chruby			heroku			libyaml			pcre2			terminal-notifier

==> Casks
~ ❯ 

bundle install works perfectly fine. Then I can run rails commands like rails console and rails db: commands with no issues.
I can also execute commands inside rails console too.
rails server launches the server as well, but as soon as I accessed the port 3000 on the browser, it crashes with this bus error.

Started GET "/" for ::1 at 2025-07-12 22:54:20 +1000
/Users/jkv-mbp/.gem/ruby/2.6.6/gems/pg-0.21.0/lib/pg.rb:56: [BUG] Bus Error at 0x0000000109946aac
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin24]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

It seems like an issue related to pg gem.

Since this doesn't work on macOS, I installed Asahi Linux on it and setup the application.
Although, its aarch64 linux, the application can be launched without any issues. But, it's not a reliable solution for my work setup.
It would be great someone can help me with this issue.

I have attached a complete crash report and the Gemfile of the project.


Files

server.log (657 KB) server.log jkvithanage (Janaka Vithanage), 07/12/2025 01:43 PM
Gemfile (5.93 KB) Gemfile jkvithanage (Janaka Vithanage), 07/12/2025 01:45 PM

Updated by jkvithanage (Janaka Vithanage) 2 days ago

Although the issue seems related to pg gem, I can run activerecord statements on a rails console session and they work perfectly fine. In that case, I may assume that this is not exactly a pg gem related issue.

Updated by peterzhu2118 (Peter Zhu) 2 days ago

  • Status changed from Open to Closed

Thank you for the bug report. You appear to be running on Ruby 2.6, which was EOL in 2022. As such, I'll be closing this issue.

The currently supported Ruby versions are Ruby 3.3 and 3.4, please upgrade and open a new ticket if you encounter any issues.

Actions

Also available in: Atom PDF

Like0
Like0Like0