Problem creating database

Hello

I have a problem with creating the database
using rake command

I have executed the following command but failed.

[root@essen test]# rake db_setup --trace
(in /usr/local/lib/ruby/coreware)
** Invoke db_setup (first_time)
** Invoke db_connect (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db_connect
** Execute db_setup
– execute(“create database test_development”)
rake aborted!
No such file or directory - /tmp/mysql.sock
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/vendor/mysql.rb:107:in
initialize' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/vendor/mysql.rb:107:innew’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/vendor/mysql.rb:107:in
real_connect' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:471:inconnect’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:165:in
initialize' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:innew’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in
mysql_connection' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:insend’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in
connection=' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:inretrieve_connection’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/migration.rb:285:inmethod_missing’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/migration.rb:265:in
say_with_time' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/migration.rb:265:in
say_with_time' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/migration.rb:281:inmethod_missing’
/usr/local/lib/ruby/coreware/lib/tasks/db_setup.rake:27
/opt/rubygems/gems/activerecord-2.0.2/lib/active_record/schema.rb:43:in
instance_eval' /opt/rubygems/gems/activerecord-2.0.2/lib/active_record/schema.rb:43:indefine’
/usr/local/lib/ruby/coreware/lib/tasks/db_setup.rake:26
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:546:in call' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:546:inexecute’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:541:in each' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:541:inexecute’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:508:in
invoke_with_call_chain' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:501:insynchronize’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:501:in
invoke_with_call_chain' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:494:ininvoke’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1931:in invoke_task' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1909:intop_level’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1909:in each' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1909:intop_level’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exception_handling' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1903:intop_level’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1881:in run' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1948:instandard_exception_handling’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:1878:in run' /opt/rubygems/gems/rake-0.8.1/bin/rake:31 /opt/rubygems/bin/rake:19:inload’
/opt/rubygems/bin/rake:19

I have configured the database.yml file as following.

  1 development:
  2   adapter: mysql
  3   database: test_development
  4   username: root
  5   password: test
  6   host: localhost
  7   encoding: utf8
  8   socket : /var/lib/mysql/mysql.sock

However it seems that the rake command is reading the
database.yml file…

I also confirmed that there aren’t any file that has
“/tmp/mysql.sock” in it.

Could I get some advice with this?

Best Regards,
Yu Watanabe

Hello

I have deployed ruby environment on CentOS 4.4.

Thank you.

You haven’t specified the correct socket for your database, in
database.yml
add another line:

socket: /var/run/mysqld/mysqld.sock

Or change it to wherever your socket is.

On Wed, May 21, 2008 at 9:34 PM, Yu Watanabe <
[email protected]> wrote:


Appreciated my help?
Recommend me on Working With Rails
http://workingwithrails.com/person/11030-ryan-bigg

I’ve found that commenting out the socket line works sometimes
(especially if it’s incorrect). I would also make sure your mysql gem
is installed correctly. It has a tendency to both give errors and say
“1 gem installed” if it gives any errors you need to reinstall it.

On May 21, 7:04 am, Yu Watanabe [email protected]

All

Thank you all. I found this was caused by the
web filtering software that is in the web server.

I tried the gem install command few times and it
has worked properly.

Thank you