Errors in rake db:create

I have a basic working knowledge about ruby and am trying to now setup ruby on rails on my personal machine which is a Windows XP machine. The versions of ruby,gems and rails are below

C:\ruby\Programs>ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\ruby\Programs>rails -v Rails 2.3.5

C:\ruby\Programs>gem -v 1.3.6 After installing rails and rubygems , I was trying to setup rails for a first project reading up from

the command gem install mysql installed one gem and gave me some documentation related errors which I figured were not a major concern after reading your ticket 1598 and others. However when I try to do rake db:create I get the following errors :

C:\rubygems-1.3.6\blog>rake db:create --trace (in C:/rubygems-1.3.6/blog) ** Invoke db:create (first_time) ** Invoke db:load_config (first_time) ** Invoke rails_env (first_time) ** Execute rails_env ** Execute db:load_config ** Execute db:create rake aborted! undefined method `' for nil:NilClass c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:55:in `create_database' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:31 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 c:/ruby/bin/rake:19:in `load' c:/ruby/bin/rake:19

Please help me out with this , I have been trying to get it work for some time now but in vain,

The gem you installed is just an interface to MySQL. You need to install MySQL as a standalone application as well.

If you have installed MySQL; you need to make sure it is running.

I would recommend using sqlite3 in development, unless you are doing something that requires MySQL or Postgres(trig functions, for example, are in the big RDB’s but not sqlite).

-Jer

did you Configure a MySQL Database ?

@Jeremy Chase

I have installed a Mysql standalone application and is running when I use the command rake db:create.

For reference I have attached the database.yml file that I have made for my ruby on rails application.

@Kannav Rajeev

I'm not sure what I need to configure in the database for the RoR application. Please help.

Thanks

kannav rajeev wrote:

did you Configure a MySQL Database ?

C:\ruby\Programs>gem -v

c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:55:in `invoke_with_call_chain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in some time now but in vain, http://groups.google.com/group/rubyonrails-talk?hl=en.

-- Thanks: Rajeev sharma

Attachments: http://www.ruby-forum.com/attachment/4534/database.yml

its fine you done try this at once without sockt

development: adapter: mysql encoding: utf8 database: blog_development pool: 5 username: root password:

still you have error please copy and paste that Error here

I tried it without the socket but no luck , here is the error log

C:\RUBYGE~1.6\blog>rake db:create --trace (in C:/RUBYGE~1.6/blog) ** Invoke db:create (first_time) ** Invoke db:load_config (first_time) ** Invoke rails_env (first_time) ** Execute rails_env ** Execute db:load_config ** Execute db:create rake aborted! undefined method `' for nil:NilClass c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:55:in `create_database' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:31 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 c:/ruby/bin/rake:19:in `load' c:/ruby/bin/rake:19

kannav rajeev wrote:

i have three Guesses try these

rake gems:install

or saw in config/environment.rb is this file showing in Error console iy yes comment it out then restart servers

or if more bad luck you have Please make this whole app Again this step is recommended.. better luck next time... thanks

Hey sorry i think first please write yours migration code so i can help you out. First Do this then else thanks ..

Thanks everyone , it turns out that doing the age-old trick of re-installing the app has solved this problem.

Thanks,

kannav rajeev wrote:

Which app?

Colin