Localhost issues

I just setup ruby and was trying to run the following commands:

class Story < ActiveRecord::Base; end

=> nil

story = Story.new

SocketError: getaddrinfo: Name or service not known
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/vendor/mysql.rb:111:in
`initialize'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/vendor/mysql.rb:111:in
`new'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/vendor/mysql.rb:111:in
`real_connect'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/mysql_adapter.rb:471:in
`connect'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/mysql_adapter.rb:165:in
`initialize'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/mysql_adapter.rb:88:in
`new'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/mysql_adapter.rb:88:in
`mysql_connection'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in
`send'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in
`connection='
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:in
`retrieve_connection'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1007:in
`columns'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:2290:in
`attributes_from_column_definition_without_lock'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/locking/optimistic.rb:55:in
`attributes_from_column_definition'
        from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1849:in
`initialize'
        from (irb):2:in `new'
        from (irb):2>>

From what I read it said that there might be problem with /etc/hosts
I checked it and what I have in there is:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost

···

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

This is the ruby version i'm using:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]

···

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

Have you checked your config/database.yml ?? try to restart your console
and open new cmd or shell then start again your console. If still error
try to update your Gem Active Record.

FX

Harp Oon wrote:

···

This is the ruby version i'm using:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]

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