# Unable to rake db:create

**URL:** <https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996>\
**Category:** rubyonrails-talk\
**Created:** [October 12, 2010, 5:02am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996 "2010-10-12T05:02:07Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 5:02am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/1 "2010-10-12T05:02:07Z")

</div>

I m using ruby 1.8.7 on rails 2.3.5 with mysql 5.0 on windows. C:\Ruby187\rails\accounts\>rake db:create (in C:/Ruby187/rails/accounts) rake aborted! syntax error on line 2, col 0: `encoding:utf8'

The following is the yml file i'm using

development: adapter:mysql encoding:utf8 reconnect:false database:accounts\_development pool:5 username: password: host:localhost

There are no spaces in the file. Only one after password

In mysql i haven't set any password.(Though the default is root as whem mysql console i open it asks for pwd and on entering root it opens).

Kindly suggest.

Premanshu

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 5:09am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/2 "2010-10-12T05:09:38Z")

</div>

What is the error please run rake db:create --trace and post resluts here

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 5:17am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/3 "2010-10-12T05:17:21Z")

</div>

@Rajeev, Pls find the results

C:\Ruby187\rails\accounts\>rake db:create --trace (in C:/Ruby187/rails/accounts) \*\* Invoke db:create (first\_time) \*\* Invoke db:load\_config (first\_time) \*\* Invoke rails\_env (first\_time) \*\* Execute rails\_env \*\* Execute db:load\_config rake aborted! syntax error on line 2, col 0: `encoding:utf8' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `databas e\_configuration' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:4 C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke\_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke\_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep tion_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard\_excep tion\_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 C:/Ruby187/bin/rake:19:in `load' C:/Ruby187/bin/rake:19

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 5:20am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/4 "2010-10-12T05:20:53Z")

</div>

please see syntax error on line 2, col 0: `encoding:utf8’ provide space as per [http://guides.rubyonrails.org/getting\_started.html](http://guides.rubyonrails.org/getting_started.html)

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 5:45am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/5 "2010-10-12T05:45:28Z")

</div>

I have provided the spaces as well but no luck.

The error this time though is :

rake aborted! syntax error on line 8, col 15: `Æ'

Premanshu

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 5:51am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/6 "2010-10-12T05:51:28Z")

</div>

paste output with trace

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 6:06am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/7 "2010-10-12T06:06:33Z")

</div>

The output is all same except:

rake aborted! syntax error on line 8, col 15: `n'

The yml file at [application\_name]/config/ is as follows:

development: adapter:mysql encoding:utf8 reconnect:false database:accounts\_development pool:5 username: root password: host:localhost

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 6:12am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/8 "2010-10-12T06:12:20Z")

</div>

please provide a traced aoutput

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 6:26am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/9 "2010-10-12T06:26:32Z")

</div>

C:\Ruby187\rails\accounts\>rake db:migrate --trace (in C:/Ruby187/rails/accounts) \*\* Invoke db:migrate (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment rake aborted! syntax error on line 8, col 15: `¼+?' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `databas e\_configuration' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:437:in `initial ize_database' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:141:in `process ' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run' C:/Ruby187/rails/accounts/config/environment.rb:9 C:/Ruby187/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in `gem_original _require' C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/depende ncies.rb:156:in `require' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/depende ncies.rb:521:in `new\_constants\_in' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/depende ncies.rb:156:in `require' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4 C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke\_with\_cal l\_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke\_with\_cal l\_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke\_with\_cal l\_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke\_with\_cal l\_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke\_task' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard\_excep tion\_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep tion_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 C:/Ruby187/bin/rake:19:in `load' C:/Ruby187/bin/rake:19

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 6:49am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/10 "2010-10-12T06:49:48Z")

</div>

provide space in 8th line after password:

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 12, 2010, 7:47am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/11 "2010-10-12T07:47:25Z")

</div>

I had provided a space as well. The output is :

rake aborted! syntax error on line 8, col 15: `n' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `databas e\_configuration' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:4 C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke\_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke\_prerequi sites' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal l_chain' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep tion_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top\_level' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard\_excep tion\_handling' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 C:/Ruby187/bin/rake:19:in `load' C:/Ruby187/bin/rake:19

Pls let me know if the genrated yml file has to be changed a lot. I have truncated my file to

test: adapter:mysql encoding:utf8 reconnect:false database:accounts\_test pool:5 username: root password: host:localhost

---

<div class="post-metadata">

**Author:** ![Rajeev\_Kannav\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Rajeev\_Kannav\_Sharma](https://discuss.rubyonrails.org/u/Rajeev_Kannav_Sharma)\
**Post date:** [October 12, 2010, 7:54am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/12 "2010-10-12T07:54:50Z")

</div>

no man its about space only you have to give a space after evry columns

---

<div class="post-metadata">

**Author:** ![Luis\_Lavena](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@Luis\_Lavena](https://discuss.rubyonrails.org/u/Luis_Lavena)\
**Post date:** [October 12, 2010, 11:47am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/13 "2010-10-12T11:47:55Z")

</div>

YAML is a very space sensitive format. You need to respect spaces in nested keys and also between keys and their values.

If you respected the generated config/database.yml would notice it.

See this:

[http://pastie.org/1215173](http://pastie.org/1215173)

Notice the 2 leading spaces and the space between ":"

Also, you need an username.

Please, save the file in plain text, not UTF (the weird characters you're getting in the output is due garbage added by your editor).

---

<div class="post-metadata">

**Author:** ![Raghavendra\_Joshi](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@Raghavendra\_Joshi](https://discuss.rubyonrails.org/u/Raghavendra_Joshi)\
**Post date:** [October 12, 2010, 12:48pm UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/14 "2010-10-12T12:48:06Z")

</div>

hi, Actually while installing mysql 5.0 it asks for password. Google for how to set the password in mysql and in your database.yml file, maintain single space between every field e.g. adapter: mysql, encoding: utf8 and so on..... This might solve your problem.

---

<div class="post-metadata">

**Author:** ![Raghavendra\_Joshi](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@Raghavendra\_Joshi](https://discuss.rubyonrails.org/u/Raghavendra_Joshi)\
**Post date:** [October 12, 2010, 12:55pm UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/15 "2010-10-12T12:55:43Z")

</div>

hi, you better reinstall mysql. While installing it will ask for password. and default user name is "root"

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 13, 2010, 7:36am UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/16 "2010-10-13T07:36:59Z")

</div>

Hi all,

Thanks a ton for the suggestions..It has finally worked...The problem was with the yaml file and spaces..

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [September 4, 2013, 2:04pm UTC](https://discuss.rubyonrails.org/t/unable-to-rake-db-create/54996/17 "2013-09-04T14:04:33Z")

</div>

Thanks to you all..... rajeevsharma and others

Finally it was worked... 😃

rake db:migrate --trace and utf-8 was working for me to get out from the error... i successfully installed ruby193 in my windows8 and connected it with mysql5.6 Thanks to every body.... if any one need the instructions how to install ruby193 i will send you the document with instructions 😃 mail me at pvvsmk.adm.srin@gmail.com
