Rails server is not starting on MAC M2

156 Views Asked by At

I am trying to run a rails app on my Mac M2 but it's always freezes during the puma boot process.

=> Booting Puma
=> Rails 7.0.7.2 application starting in development
=> Run `bin/rails server --help` for more startup options

This app runs fine on my linux machine. The app uses postgres as db and webpacker for handling assets. I tried debugging by using binding.pry in application.rb, to see if everything is being loaded properly and everything's fine there. It loads the initializers also. After that for some reason the boot up process hangs. At last I have to forcefully kill the process.

Also it's the same with all rails process. eg: rails c also freezes up and never starts. Ruby version is 3.1.2

Please help me out here.

2

There are 2 best solutions below

1
Phúc Nguyễn Đình Hữu On

Update Dependencies: Make sure you have the latest versions of Rails, Puma, Postgres, and other dependencies specified in your Gemfile. You can update your Gemfile with the desired versions and run bundle update to update the dependencies.

Check Postgres Connection: Verify that your Postgres database is running and accessible from your Rails app. Ensure that the database configuration in config/database.yml is correctly set up to connect to your Postgres instance.

1
kwerle On

Punt on the whole thing. Install docker and do all your work in containers. Obviously this stuff works for others. With docker you know exactly what you're using and all the dependencies. If it works for anyone it'll work for you.