无法在Windows上使用RubyStack 2.1-1 dev下的Spree运行db:migrate

时间:2011-03-11 22:49:23

标签: ruby-on-rails windows windows-7 spree

我正在尝试在Windows上的Spree下安装RubyStack 2.1-1 dev

我已经能够安装所有内容,但是我在初始化db时遇到了问题。在文档(http://spreecommerce.com/documentation/getting_started.html)中说我需要运行rake db:bootstrap

但它引发了以下情况:

** Invoke db:bootstrap (first_time)
** Execute db:bootstrap
This task will destroy any data in the database. Are you sure you want to
continue? [y/n] y
** Invoke db:remigrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:remigrate
** Invoke db:migrate (first_time)
** Invoke environment
** Execute db:migrate
==  SpreeZeroNineZero: migrating ==============================================
-- create_table("addresses", {:force=>true})
   -> 0.0160s
-- create_table("adjustments", {:force=>true})
   -> 0.0140s
-- create_table("assets", {:force=>true})
   -> 0.0140s
-- create_table("calculators", {:force=>true})
   -> 0.0140s
-- create_table("checkouts", {:force=>true})
   -> 0.0350s
-- create_table("configurations", {:force=>true})
   -> 0.0160s
-- add_index("configurations", ["name", "type"], {:name=>"index_configurations_on_name_and_type"})
rake aborted!
An error has occurred, all later migrations canceled:

Invalid date: BTREE
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:44
6:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/connection_adapters/mysql2_adapter.rb:44
6:in `indexes'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/schema_statements
.rb:406:in `index_name_exists?'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/schema_statements
.rb:343:in `add_index'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:383:in `block in method_missing'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:359:in `block in say_with_time'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/1.9.1/benchmark.rb:294:in `measure'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:359:in `say_with_time'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:379:in `method_missing'
D:/Users/Administrator/Projects/Delko/src/db/migrate/20090823005402_spree_zero_nine_zero.rb:74:in `up'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:312:in `block in migrate'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/1.9.1/benchmark.rb:294:in `measure'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:312:in `migrate'
D:in `migrate'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:537:in `block (2 levels) in migra
te'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:613:in `call'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:613:in `ddl_transaction'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:536:in `block in migrate'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:523:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:523:in `migrate'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:433:in `up'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/migration.rb:415:in `migrate'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:142:in `block (2 level
s) in <top (required)>'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/spree_core-0.40.2/lib/tasks/core.rake:53:in `block (2 levels) in <top (required)>'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/spree_core-0.40.2/lib/tasks/core.rake:71:in `block (2 levels) in <top (required)>'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
D:/Program Files/BitNami RubyStack Development/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
D:/Program Files/BitNami RubyStack Development/ruby/bin/rake:19:in `load'
D:/Program Files/BitNami RubyStack Development/ruby/bin/rake:19:in `<main>'

不知道这是什么= S

谢谢

1 个答案:

答案 0 :(得分:1)

修正了以下问题:https://github.com/brianmario/mysql2/issues?authenticity_token=7fc933f9b5509f3efc173dd57522872113f9878d#issue/71

这似乎是libmysql.dll的x64版本的问题,因此他们建议下载mysql 5.1 x86并替换libmysql.dll。

所以我做的是:

  1. 已下载mysql 5.1 x32 (zip archive)
  2. 使用下载的zip中的libmysql.dll替换{path-to-rubystack} /mysql/bin/libmysql.dll。
  3. 重新运行db:bootstrap
  4. 享受狂欢=)