SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rails Book Page 171: I'm getting the following error:

    After writing the unit tests as described in the text, I am receiving the following error:

    C:\shovell>rake test:units
    (in C:/shovell)
    rake aborted!
    Bad file descriptor - connect(2)

    (See full trace by running task with --trace)

    Any ideas???

    Here is the --trace output:

    C:\shovell>rake test:units --trace
    (in C:/shovell)
    ** Invoke test:units (first_time)
    ** Invoke db:test:prepare (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Execute db:test:prepare
    ** Invoke db:test:clone (first_time)
    ** Invoke db:schema:dump (first_time)
    ** Invoke environment
    ** Execute db:schema:dump
    ** Invoke db:test:purge (first_time)
    ** Invoke environment
    ** Execute db:test:purge
    rake aborted!
    Bad file descriptor - connect(2)
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysq
    l.rb:111:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysq
    l.rb:111:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/vendor/mysq
    l.rb:111:in `real_connect'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/mysql_adapter.rb:389:in `connect'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/mysql_adapter.rb:152:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/mysql_adapter.rb:82:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/mysql_adapter.rb:82:in `mysql_connection'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/abstract/connection_specification.rb:262:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/abstract/connection_specification.rb:262:in `connection_without_query_c
    ache='
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/query_cache
    .rb:54:in `connection='
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
    adapters/abstract/connection_specification.rb:78:in `connection'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/tasks/databases.rake:120
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `synchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:in `invoke_prerequisit
    es'

  2. #2
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops. I figured it out. The database.yml file was not configured properly for my test database.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •