ruby on rails - YAML syntax error occurred while parsing config/database.yml -
please note yaml must consistently indented using spaces. tabs not allowed.
error: (): found character cannot start token while scanning next token @ line 17 column 13
ruby version : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] rails version : rails 4.2.3
i'm using ubuntu 14.04 lts 64-bit
full database.yml
file:
# mysql. versions 5.0+ recommended. # # install mysql driver # gem install mysql2 # # ensure mysql gem defined in gemfile # gem 'mysql2' # # , sure use new-style password hashing: # http://dev.mysql.com/doc/refman/5.0/en/old-client.html # default: &default adapter: mysql2 encoding: utf8 pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock development: <<: *default database: readit_development # warning: database defined "test" erased , # re-generated development database when run "rake". # not set db same development or production. test: <<: *default database: readit_test # config/secrets.yml, never want store sensitive information, # database password, in source code. if source code # ever seen anyone, have access database. # # instead, provide password unix environment variable when boot # app. read http://guides.rubyonrails.org/configuring.html#configuring-a-database # full rundown on how provide these environment variables in # production deployment. # # on heroku , other platform providers, may have full connection url # available environment variable. example: # # database_url="mysql2://myuser:mypass@localhost/somedatabase" # # can use database configuration with: # # production: # url: <%= env['database_url'] %> # production: <<: *default database: readit_production username: readit password: <%= env['readit_database_password'] %>
this looks either error in parser using, or, philip suggested, hidden character.
using
yaml round-trip database.yml
you no parser error, , same output input file, except empty lines (dropped) , mapping value of development
inconsistently indented @ 1 space (but not yaml error, requires consistent indenting within same mapping/sequence).
Your blog is in a convincing manner, thanks for sharing such an information with lots of your effort and time
ReplyDeleteruby on rails training
ruby on rails training India
ruby on rails training Hyderabad