ruby-on-railsrubynginxunicornpuma

Nginx and Unicorn) Cannot access local server


After deploying my Application(Ruby on Rails) to Heroku using Nginx and Unicorn, I cannot access local server.

When I run 'rails s' command:

% rails s
=> Booting Unicorn
=> Rails 5.2.4.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
I, [2021-02-24T21:38:31.580195 #65055]  INFO -- : unlinking existing socket=/tmp/nginx.socket
I, [2021-02-24T21:38:31.580518 #65055]  INFO -- : listening on addr=/tmp/nginx.socket fd=15
I, [2021-02-24T21:38:31.582319 #65055]  INFO -- : master process ready
I, [2021-02-24T21:38:31.583415 #65069]  INFO -- : worker=0 spawned pid=65069
I, [2021-02-24T21:38:31.584169 #65069]  INFO -- : worker=0 ready

Accessing 'http://localhost:3000', I got 'Cannot access this page. Access denied at localhost' or something like that(Original message appears in Japanese).

With the message 'Booting Unicorn' I know that local server switched from Puma to Unicorn, but no idea about the error reason cause I got no error messages.

If more information needed I can provide.

I'm new to Nginx and Unicorn, so any help would be greatly appreciated.


Solution

  • Problem solved when I moved the gem 'unicorn' under production environment. After this, I run 'rails s' command and Puma booted up, finally I can access local server.

    Thank you so much!