Q: Syntax unexpected end of input I keep getting an error that says 
warning: mismatched indentations at 'end' with 'class' at 20
syntax error unexpected end of input expecting keyword end
the file name is application.rb in a rails application tutorial I am trying to do.
Following is the code for the whole file. I am getting the error on the last end.
Here is the code
require_relative 'boot'

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Listing
  class Application < Rails::Application
    config.generators do |g|
      g.test_framework :rspec, fixtures: true, view_specs: false, helper_specs: false,
      routing_specs: false, controller_specs: true, request_specs: false
      g.fixtures_replacement :factory_girl, dir: "spec/factories"
  end
end

If I take out all of the code between class application and the first end then there are no problems.
Can someone please locate the problem. I am using Cloud 9 IDE.

A: You haven't ended do block. Change module like below:
module Listing
  class Application < Rails::Application
    config.generators do |g|
      g.test_framework :rspec, fixtures: true, view_specs: false, helper_specs: false,
      routing_specs: false, controller_specs: true, request_specs: false
      g.fixtures_replacement :factory_girl, dir: "spec/factories"
    end
  end
end


A: Try this:
module Listing
    class Application < Rails::Application
      config.generators do |g|
        g.test_framework :rspec, fixtures: true, view_specs: false,helper_specs:false,
        routing_specs: false, controller_specs: true, request_specs: false
        g.fixtures_replacement :factory_girl, dir: "spec/factories"
      end
    end
end

