Rails not allowing me to create controller file

rails

#1

I am following the http://guides.rubyonrails.org/getting_started.html
and I am on part 4.2 where I need to create

bin/rails generate controller Welcome index

and I get the following error

bin/rails generate controller Welcome index
/usr/local/rvm/gems/ruby-2.3.1/gems/railties-5.1.5/lib/rails/application/configuration.rb:144:in `rescue in database_configuration': YAML syntax error occurred while parsing /home/ubuntu/workspace/blog/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): mapping values are not allowed in this context at line 14 column 8 (RuntimeError)
        from /usr/local/rvm/gems/ruby-2.3.1/gems/railties-5.1.5/lib/rails/application/configuration.rb:127:in `database_configuration'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activerecord-5.1.5/lib/active_record/railtie.rb:121:in `block (2 levels) in <class:Railtie>'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:49:in `each'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activerecord-5.1.5/lib/active_record/base.rb:326:in `<module:ActiveRecord>'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activerecord-5.1.5/lib/active_record/base.rb:25:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/dependencies.rb:292:in `require'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/dependencies.rb:292:in `block in require'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.1.5/lib/active_support/dependencies.rb:292:in `require'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:356:in `active_record_configured?'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:273:in `disconnect_database'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:107:in `preload'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from /usr/local/rvm/gems/ruby-2.3.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

And here is my YAML

rails s -b $IP -p $PORT

default: &default
  adapter: mysql2
  encoding: utf8
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password: root
  socket: /var/run/mysqld/mysqld.sock

development:
  adapter: mysql2
  encoding: utf8
  database: c9
  username: <%=ENV['C9_USER']%>
  host: <%=ENV['IP']%>

production:
  <<: *default
  database: blog_production
  username: blog
  password: <%= ENV['BLOG_DATABASE_PASSWORD'] %>

#2

I assume you have migrated the database and it is running so.

You can check your YAML file using something like http://www.yamllint.com/