Unable to create mysql db in rails

i have been learning rails from
http://guides.rubyonrails.org/getting_started.html and in part creating
the
data base i have changed config/databae.yml to
development:
adapter: mysql2
encoding: utf8
database: blog_development
pool: 5
username: myname
password: mypass
host: localhost
socket:/tmp/mysql.sock

to enable me to use MySQL-server…
so when i used rake db:create
then i get this error

rake aborted!
(): could not find expected ‘:’ while scanning a simple key at
line 14 column 3

so when i traced i found this errors

** 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!
(): could not find expected ‘:’ while scanning a simple key at
line 14 column 3
/home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in
parse' /home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:inparse_stream’
/home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in
parse' /home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:inload’
/home/niraj/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/configuration.rb:115:in
database_configuration' /home/niraj/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:6:inblock (2 levels) in <top (required)>’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
call' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
each' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain' /home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:176:inblock in invoke_prerequisites’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
each' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:ininvoke_prerequisites’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
block in invoke_with_call_chain' /home/niraj/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
block in run' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling’
/home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run' /home/niraj/.rvm/gems/[email protected]/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>’
/home/niraj/.rvm/gems/[email protected]/bin/rake:19:in load' /home/niraj/.rvm/gems/[email protected]/bin/rake:19:in

help me … how to run rake db:create?? and should i keep test and
production same in config/database.yml ??

thank u !!

On Fri, Jul 20, 2012 at 12:11 AM, amature [email protected]
wrote:

so when i used rake db:create

(): could not find expected ‘:’ while scanning a simple key at line
14 column 3

So, what is line 14 ?

… and should i keep test and production same in config/database.yml ??

The “same” as what?


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

On Fri, Jul 20, 2012 at 8:55 AM, amature [email protected]
wrote:

(): could not find expected ‘:’ while scanning a simple key at
line 14 column 3

i dont know which line or column :frowning:

Uh, what? Even if you’re using a code editor that doesn’t show line
numbers, I would hope you can count.

But please, start by installing a suitable editor.


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

thanks for reply…
i changed
socket:/tmp/mysql.sock to
socket: /tmp/mysql.sock and thar error has gone but i face new error
now…it says

rake aborted!
Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (mysql2 is not part of the bundle. Add it
to
Gemfile.)
…learning rails in ubuntu has been lot harder than i thought :(…thx

The “same” as what?
i mean to say test and production code same as in default

On Fri, Jul 20, 2012 at 10:13 PM, amature [email protected]
wrote:

rake aborted!
Please install the mysql2 adapter: gem install activerecord-mysql2-adapter
(mysql2 is not part of the bundle. Add it to Gemfile.)
…learning rails in ubuntu has been lot harder than i thought :(…thx

And it will be hard forever, if you don’t read and act on the messages
you’re presented with. The above gives you specific actions to take;
have you done them? If not, why not?


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

On 21 July 2012 06:13, amature [email protected] wrote:

thanks for reply…
i changed
socket:/tmp/mysql.sock to
socket: /tmp/mysql.sock and thar error has gone but i face new error now…it
says

rake aborted!
Please install the mysql2 adapter: gem install activerecord-mysql2-adapter
(mysql2 is not part of the bundle. Add it to Gemfile.)
…learning rails in ubuntu has been lot harder than i thought :(…thx

Try railstutorial.org, which is free to use online. You might find it
an easier way to get started as it leads you through the basic
principles one step at a time.

Colin