How to restart rails server

Question

Sorry it seems like a stupid question, but how do you restart a rails server? I'm following through a Youtube video series and am stuck at the part where it wouldn't let me use the red carpet gem even though I've already installed it. This is what showed after I typed "Rails server" in the terminal

=> Booting Puma 
=> Rails 5.0.1 application starting in development on http://localhost:3000 
=> Run `rails server -h` for more startup options Exiting /Users/ivychen/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `action_mailer' for #<Rails::Application::Configuration:0x007f8a99846608> (NoMethodError)  
from /Users/ivychen/Code/blog/config/environments/development.rb:30:in `block in <top (required)>'  
from /Users/ivychen/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/railtie.rb:209:in `instance_eval'  
from /Users/ivychen/.rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/railtie.rb:209:in `configure'  
from /Users/ivychen/Code/blog/config/environments/development.rb:1:in `<top (required)>'  
from /Users/ivychen/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'  
from /Users/ivychen/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'  

Can anyone help me what went wrong?

Here's what's in my development.rb file

Rails.application.configure do
  config.cache_classes = false
  config.eager_load = false
  config.consider_all_requests_local = true
  if Rails.root.join('tmp/caching-dev.txt').exist?
  config.action_controller.perform_caching = true
  config.cache_store = :memory_store
  config.public_file_server.headers = {
  'Cache-Control' => 'public, max-age=172800'
    }
  else
    config.action_controller.perform_caching = false
config.cache_store = :null_store
  end
  config.active_support.deprecation = :log
  config.active_record.migration_error = :page_load
  config.assets.debug = true
  config.assets.quiet = true
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

Show source
| rubygems   | ruby-on-rails   2016-12-30 19:12 1 Answers

Answers to How to restart rails server ( 1 )

  1. 2016-12-30 20:12

    You don't actually need to restart the server, since it's raising an exception on boot. You are calling method action_mailer on config/environments/development.rb, line 30, when it doesn't exist. Resolve that and rails server should work again.

Leave a reply to - How to restart rails server

◀ Go back