2013-06-05 76 views
0

我在使用rake db:create創建數據庫時遇到問題。爲什麼Rake因「壞文件描述符」而中止?

我遵循「Fat Free CRM Guides: Installation on Microsoft Windows」指南在Windows上安裝Fat Free CRM。

我在32位Windows 7上。Rake是0.8.7。 RubyGems是2.0.3,Ruby是1.9.3。我正在使用MySQL2 v0.2.6。

我得到的錯誤是:

C:\RailsInstaller\fat_free_crm>rake db:create RAILS_ENV=production --trace 
** Invoke db:create (first_time) 
** Invoke db:load_config (first_time) 
** Execute db:load_config 
** Invoke rails_env (first_time) 
** Execute rails_env 
** Execute db:create 
rake aborted! 
Bad file descriptor 

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:312:in `query' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:312:in `execute' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:629:in `configure_connecti 
on' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:169:in `initialize' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connectio 
n' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_ 
connection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 leve 
ls) in checkout' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in chec 
kout' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in conn 
ection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_conn 
ection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retr 
ieve_connection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `conn 
ection' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:120:in `rescue in create_database' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:85:in `create_database' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `block (3 levels) in <top (required)>' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `each' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:62:in `block (2 levels) in <top (required)>' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/applic.... 
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load' 
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>' 
Tasks: TOP => db:create 

C:\RailsInstaller\fat_free_crm>[/code] 

我改變的libmysql.dll爲WIN7 - 32位

database.yml中的配置是:

development: 
adapter: mysql2 
encoding: utf8 
database: fat_free_crm_development 
pool: 5 
username: root 
password: ale 
#socket: /var/run/mysqld/mysqld.sock 
host: localhost 
#host: 127.0.0.1 
port: 3306 

test: 
#<<: *development 
database: fat_free_crm_test 

production: 
#<<: *development 
adapter: mysql2 
encoding: utf8 
#database: crm_production 
database: fat_free_crm_production 
pool: 5 
username: root 
password: ale 
#socket: /tmp/mysql.sock 
#host: 127.0.0.1 
host: localhost 
port: 3306 

staging: 
#<<: *development 
database: fat_free_crm_staging 

沒有人有任何的想法?

+0

不要把你的重要信息放在你的問題中的其他網站的鏈接。當鏈接斷開時,你的問題對其他人尋找相同答案將毫無價值。此外,你迫使我們做額外的工作,試圖幫助你,這是行不通的。將信息減少到最低限度,並將其包含在您的問題中。也花時間格式化您的問題,以便閱讀。幫助我們幫助你。 –

+0

我已取消鏈接,並添加了代碼。 –

回答

0

在第9,25,29,43行刪除了&development<<*development。我認爲你的database.yml文件中有語法錯誤。

+0

刪除&開發和<< *開發,但錯誤是一樣的。還重新加載Apache。有疑問,在phpmyadmin中,我不一定要創建數據庫fat_free_crm_development/testing/enviroment/production,是真的嗎? –