4

私は周りを検索しましたが、うまくいく答えを見つけることができませんでした。

私はこれがまったく初めてなので、答えるときは、私が子供であるかのように説明してください... または私がブロッコリーの一部であるかのように説明してください. 何かをインストールしてほしい場合は、何を書くか教えてください。

さて、私はこのhttp://guides.fatfreecrm.com/Setup-Microsoft-Windows.htmlに従おうとしていますが、私が書くべき場所に来ました rake db:create RAILS_ENV=production 。 「gem install mysql2」、チュートリアルのようにrakeをインストールしましたが、問題は見られませんでした)

C:\RailsInstaller\fat_free_crm>rake db:create RAILS_ENV=production --trace   

** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** 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/li
b/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/li
b/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/li
b/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/li
b/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/li
b/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/li
b/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.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:309:in
`new_connection '
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:319:in
`checkout_new_c onnection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:241:in
`block (2 level s) in checkout'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:236:in
`loop'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:236:in
`block in check out'
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.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:233:in
`checkout'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:96:in `block
in connec tion'
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.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:95:in
`connection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:404:in
`retrieve_conne ction'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_specification.rb:170:in
`retri eve_connection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/connection_adapters/abstract/connection_specification.rb:144:in
`conne ction'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/railties/databases.rake:83:in `rescue in create_database'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/railties/databases.rake:51:in `create_database'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/railties/databases.rake:40:in `block (3 levels) in <top
(required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/railties/databases.rake:40:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/acti
ve_record/railties/databases.rake:40:in `block (2 levels) in <top
(required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:205:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:205:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:200:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:200:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:158: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-0.9.2.2/lib/rake/task.
rb:151:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.
rb:144:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:116:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:88:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:66:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in
`<top (required)>' C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>' Tasks: TOP =>
db:create
4

1 に答える 1

1

私は同じ問題を抱えていて、2時間かけて修正しました。あなたにも役立つかもしれません。したがって、ここに問題を解決するための手順があります

  1. 64 ビット + 32 ビットの mysql の問題は別の可能性があるため、32 ビットの mysql を実行していると想定しています。
  2. mysql.dll がインストールされた gem と互換性があることを確認してください (mysql2 を使用しています)。
  3. 問題を回避するには、http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pickからダウンロードします
  4. mysql.dll を ruby​​/bin にコピーします。

要約: 私にとっては、rails mysql2 gem と私のマシンにインストールされたものとの間の非互換性の問題でした。

于 2012-10-29T12:39:02.930 に答える