When I do rails s
, it successfully starts my server, and serves the page through the URL http://localhost:3000
, but the problem is: it doesn't show any changes when I access anything from this server.
I have accessed so many pages, but still it's not showing any hint. I have restarted the Rails server, have killed all the rails servers using:
ps aux | grep 'rails' | grep -v 'grep' | awk '{ print $2 }' | xargs kill -9
Have quit and started again iTerm but nothing is helping me.
I'm using Rails 5.0.0, and ruby 2.2.3.
Add this in development.rb
file. I have my app on Rails 6.
config.logger = Logger.new(STDOUT)
There was a problem in config/puma.rb file, and it took me a night to figure this thing out. Anyway, the correct configuration for Puma while running your server for development is:
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
# Worker specific setup for Rails 4.1+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With