Errors in rake db:create

12 views
Skip to first unread message

Tasneem Yusuf

unread,
Mar 2, 2010, 7:51:56 AM3/2/10
to rubyonra...@googlegroups.com
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
http://guides.rubyonrails.org/getting_started.html

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,
--
Posted via http://www.ruby-forum.com/.

Jeremy Chase

unread,
Mar 2, 2010, 7:57:31 AM3/2/10
to rubyonra...@googlegroups.com
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




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


kannav rajeev

unread,
Mar 2, 2010, 7:59:21 AM3/2/10
to rubyonra...@googlegroups.com
did you Configure a MySQL Database ?

> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


--
Thanks:
Rajeev sharma

Tasneem Yusuf

unread,
Mar 4, 2010, 6:14:39 AM3/4/10
to rubyonra...@googlegroups.com
@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 ?
>
> On 3/2/10, Tasneem Yusuf <li...@ruby-forum.com> wrote:
>> 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

kannav rajeev

unread,
Mar 4, 2010, 6:18:22 AM3/4/10
to rubyonra...@googlegroups.com
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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Thanks:
Rajeev sharma

Tasneem Yusuf

unread,
Mar 4, 2010, 6:25:49 AM3/4/10
to rubyonra...@googlegroups.com
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)

kannav rajeev wrote:
> 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
>
> On Thu, Mar 4, 2010 at 4:44 PM, Tasneem Yusuf <li...@ruby-forum.com>
> wrote:
>
>> I'm not sure what I need to configure in the database for the RoR
>> >>

>> > Thanks:


>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonra...@googlegroups.com.
>> To unsubscribe from this group, send email to

>> rubyonrails-ta...@googlegroups.com<rubyonrails-talk%2Bunsu...@googlegroups.com>


>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
> --
> Thanks:
> Rajeev sharma

--
Posted via http://www.ruby-forum.com/.

kannav rajeev

unread,
Mar 4, 2010, 8:20:52 AM3/4/10
to rubyonra...@googlegroups.com
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

> --


> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to

> rubyonrails-ta...@googlegroups.com.

kannav rajeev

unread,
Mar 4, 2010, 8:24:02 AM3/4/10
to rubyonra...@googlegroups.com
Hey sorry i think first please write yours migration code so i can
help you out. First Do this then else thanks ..


--
Thanks:
Rajeev sharma

Tasneem Yusuf

unread,
Mar 5, 2010, 10:00:27 AM3/5/10
to rubyonra...@googlegroups.com
Thanks everyone , it turns out that doing the age-old trick of
re-installing the app has solved this problem.

Thanks,

kannav rajeev wrote:
> Hey sorry i think first please write yours migration code so i can
> help you out. First Do this then else thanks ..
>
> On 3/4/10, kannav rajeev <rajeevs...@gmail.com> wrote:

>> thanks
>>> ** Execute rails_env


>>> 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:2029:in `each'
>>> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
>>>> adapter: mysql
>>>> wrote:
>>>>> .
>>> --


>>>
>>>
>>
>>
>> --
>> Thanks:
>> Rajeev sharma
>>
>
>
> --
> Thanks:
> Rajeev sharma

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Mar 5, 2010, 11:32:40 AM3/5/10
to rubyonra...@googlegroups.com
On 5 March 2010 15:00, Tasneem Yusuf <li...@ruby-forum.com> wrote:
> Thanks everyone , it turns out that doing the age-old trick of
> re-installing the app has solved this problem.

Which app?

Colin

Reply all
Reply to author
Forward
0 new messages