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:in
new’
/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:in
connect’
/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:in
new’
/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:in
send’
/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:in
retrieve_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:in
method_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:in
measure’
/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:in
method_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:in
define’
/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:in
execute’
/opt/rubygems/gems/rake-0.8.1/lib/rake.rb:541:in each' /opt/rubygems/gems/rake-0.8.1/lib/rake.rb:541:in
execute’
/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:in
synchronize’
/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:in
invoke’
/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:in
top_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:in
top_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:in
top_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:in
standard_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:in
load’
/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