My rails application(in local) suddenly stop responding to requests - ruby-on-rails

I have been working on a rails application for the past four months. Suddenly one-day puma server stops responding to the requests.
Here is what I see in the terminal:
$ rails s
=> Booting Puma
=> Rails 5.1.7 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
Puma version: 5.5.2 (ruby 2.6.3-p62) ("Zawgyi")
Min threads: 5
Max threads: 5
Environment: development
PID: 12446
Listening on http://127.0.0.1:3000
Listening on http://[::1]:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2021-11-10 12:28:58 +0530
Started GET "/recommendations" for ::1 at 2021-11-10 12:29:20 +0530
Started GET "/" for ::1 at 2021-11-10 12:29:39 +0530
Started GET "/" for ::1 at 2021-11-10 12:29:40 +0530
I tried many things like changing the port, making sure that the rails version in my local and gemfile are the same, trying with other ruby versions, uninstalling and reinstalling ruby and rails in local.
Tried keeping binding.pry in the application controller's index action but that not getting hit. I am not able to exit from that point, the server gets stuck there. There are no recent changes in my application.
Can anyone suggest to me what might be the problem?

Related

“rails generate controller” is not creating a controller

I am following the Rails guide http://guides.rubyonrails.org/getting_started.html and when I ran this command: rails generate controller Welcome index I couldn't find the generated files. So I ran the rails server and noticed that it says it's loading the new generated files in /Users/joseph/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/templates/rails/welcome/index.html.erb
Weird? What's going on?
~/RubymineProjects/blog
% rails server
=> Booting Puma
=> Rails 5.0.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.5.0 (ruby 2.3.0-p0), codename: Amateur Raccoon Rocketry
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2016-07-19 20:38:04 -0700
Processing by Rails::WelcomeController#index as HTML
Parameters: {"internal"=>true}
Rendering /Users/joseph/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/templates/rails/welcome/index.html.erb
Rendered /Users/joseph/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/templates/rails/welcome/index.html.erb (5.3ms)
Completed 200 OK in 23ms (Views: 11.6ms | ActiveRecord: 0.0ms)

Rails 5 + Puma + Pow not working locally

I'm updating my rails app to 5.0.0.rc1 in a separate branch. App was already configured to run on puma 2.14, but I upgraded to puma 3.4.0 during the update process.
I ran rails update but kept my old puma config around because nothing changed except the plugins directive which I don't care about now.
Anyway, I cannot get my app to respond in development mode, but I deployed it a staging server to see if I could get better error logs and it actually works on staging.
Before, I could access my app locally using pow by visiting:
http://app.dev
Now, that doesn't work. Neither does:
bundle exec puma -C config/puma.rb config.ru
Nor does this:
bin/rails server puma
My logs just show something like this everytime:
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:39 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:44 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:47 -0400
Started GET "/" for 127.0.0.1 at 2016-05-27 09:11:50 -0400
They never make it to Rails for processing no matter how I attempt to start the server locally. And that's all the error info I get, too. Pow's logs are similarly useless.
Any ideas whats going on?
The emotional successor of pow(latest commit on the repo is from 6 November 2014) is puma-dev. According to their docs pow is a no-go for Rails 5. Maybe you should give it a go.

Rails server not responding

I started a simple rails server and set the root url to display an html page. It started on localhost:3000 but when I try to access it using my browser (Internet Explorer 8) it says page cannot be diaplyed. The console is not showing any error. It just says server running on localhost:3000
Console output
=> Booting WEBrick
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-04-27 12:32:39] INFO WEBrick 1.3.1
[2016-04-27 12:32:39] INFO ruby 2.2.4 (2015-12-16) [i386-mingw32]
[2016-04-27 12:32:39] INFO WEBrick::HTTPServer#start: pid=5752 port=3000
The most probable problem of that you have firewall and it blocks the requests to server, additionally it could be happened that name localhost is redefined, so I'll propose a 3 steps to fix:
Drop your firewall or reset it to allow accessing to 127.0.0.1, that should be resolved as localhost;
Restart app as:
rails s -b 127.0.0.1
key -b tells your server to bind it on just IP: 127.0.0.1;
Enter url: http://127.0.0.1:3000

Rails server killed when requesting a preview

I am working on M.Hartl's rails tutorial and I opted out for using the cloud9 IDE instead of the local server in order to focus on learning rails and not worry about working on the server.
This is the crash error that I am getting:
thermobee:~/workspace/sample_app (filling-in-layout) $ rails s -b $IP -p $PORT
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-12-15 05:19:02] INFO WEBrick 1.3.1
[2015-12-15 05:19:02] INFO ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2015-12-15 05:19:02] INFO WEBrick::HTTPServer#start: pid=14300 port=8080
Started GET "/" for 174.113.76.61 at 2015-12-15 05:19:25 +0000
Processing by StaticPagesController#home as HTML
Rendered static_pages/home.html.erb within layouts/application (192.2ms)
Killed
It kept happening throughout the day. I would add code and it would sometimes get stuck saving the file and sometimes it the server would get killed as I try to view the work I've done so far. Every time I would get stuck at a different point as I kept deleting the git branch I was working on.
I apologize for the long winded question, but I did not know how to formulate this properly as there has been a lot going on. I can provide any files that would help solve this and I can also give you read access to the IDE files as well.

Rails server gives error when I load localhost:3000 and it's not the rack version

Before you mark this as a duplicate, know that the difference between this question and the other questions is there are no errors in the console or logs for me!
=> Booting WEBrick
=> Rails 5.0.0.alpha application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-10-25 17:32:22] INFO WEBrick 1.3.1
[2015-10-25 17:32:22] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
[2015-10-25 17:32:22] INFO WEBrick::HTTPServer#start: pid=33823 port=3000
Started GET "/" for 127.0.0.1 at 2015-10-25 17:32:35 -040
Produces a 500 internal server error: "We're sorry but something went wrong. If you are the application owner check the logs for more information."
I've tried:
changing the rack version to 1.6.2 (ruby requires >2.0)
using a different port
binding the rails server to localhost
hitting 127.0.0.1:3000, 0.0.0.1:3000, etc
Any ideas?

Resources