Forum: Ruby on Rails unable to create mysql db in rails

Aa5a718ff6c8c455c48a435ce2c9a9c8?d=identicon&s=25 amature (Guest)
on 2012-07-20 10:13
(Received via mailing list)
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!
(<unknown>): 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!
(<unknown>): 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:in
`parse_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:in
`load'
/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:in
`block (2 levels) in <top (required)>'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
`call'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
`block in execute'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
`each'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
`execute'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/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:in
`mon_synchronize'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
`invoke_with_call_chain'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in
`block in invoke_prerequisites'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
`each'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
`invoke_prerequisites'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/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:in
`mon_synchronize'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
`invoke_with_call_chain'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
`invoke'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
`invoke_task'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`block (2 levels) in top_level'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`each'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`block in top_level'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
`top_level'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
`block in run'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
`run'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in
`<top (required)>'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/home/niraj/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'


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

thank u !!
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2012-07-20 15:32
(Received via mailing list)
On Fri, Jul 20, 2012 at 12:11 AM, amature <nirajhirachan147@gmail.com>
wrote:

> so when i used rake db:create

> (<unknown>): 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 Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Aa5a718ff6c8c455c48a435ce2c9a9c8?d=identicon&s=25 amature (Guest)
on 2012-07-20 17:57
(Received via mailing list)
The "same" as what?
   i mean to say test and production code same as in default
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2012-07-20 18:17
(Received via mailing list)
On Fri, Jul 20, 2012 at 8:55 AM, amature <nirajhirachan147@gmail.com>
wrote:

>>> (<unknown>): could not find expected ':' while scanning a simple key at
>>> line 14 column 3

>> i dont know which line or column :(

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 Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Aa5a718ff6c8c455c48a435ce2c9a9c8?d=identicon&s=25 amature (Guest)
on 2012-07-21 07:14
(Received via mailing list)
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
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2012-07-21 15:18
(Received via mailing list)
On Fri, Jul 20, 2012 at 10:13 PM, amature <nirajhirachan147@gmail.com>
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 Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2012-07-21 22:37
(Received via mailing list)
On 21 July 2012 06:13, amature <nirajhirachan147@gmail.com> 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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.