SitePoint Sponsor

User Tag List

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

    Question Chapter 4: Rails Revealed -- getting an error

    Page 101. I successfully run script/console and I'm in! I am able to key 'class Story < ActiveRecord::base; end' and it returns nil, as expected. here is where I run into my error.
    -----snip--------

    >> story = Story.new
    Errno::ENOENT: No such file or directory - /tmp/mysql.sock
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:107:in `initialize'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:107:in `new'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:107:in `real_connect'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache='
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/query_cache.rb:54:in `connection='
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:760:in `columns'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:2048:in `attributes_from_column_definition_without_lock'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:45:in `attributes_from_column_definition'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/base.rb:1490:in `initialize_without_callbacks'
    from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/callbacks.rb:225:in `initialize'
    from (irb):3:in `new'

    ----snip----

    Help please :-(

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    FL
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try setting the socket in your config/database.yml file to the location of your MySQL socket using :socket.

    Let me know if that helps.
    Eric A.
    Founder and CEO, XMG Networks, Inc.
    XMG Services: Web 2.0 Photo Management and Sharing | Web Hosting
    Personal Blog: From Two 2 Twelve

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Success!

    Sorry for the newbie error


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
  •