在这里尝试运行 Paul Dix 书中的第 1 章示例:
https://github.com/pauldix/service-oriented-design-with-ruby/tree/master/chapter_01
所以我做了一个bundle install
,它工作正常。然后我做了一个rake db:migrate
,它也可以正常工作,输出如下:
➜ chapter_01 git:(master) ✗ rake db:migrate
D, [2013-05-13T13:55:13.316178 #9154] DEBUG -- : (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
I, [2013-05-13T13:55:13.316265 #9154] INFO -- : Migrating to CreateUsers (1)
现在我运行 arspec spec/service_spec.rb
它给了我以下错误,主要是说它不能让“用户”表变得有趣。
chapter_01 git:(master) ✗ rspec spec/service_spec.rb
D, [2013-05-13T13:57:16.893140 #9166] DEBUG -- : env: test
D, [2013-05-13T13:57:16.936232 #9166] DEBUG -- : db/test.sqlite3 database connection established...
/Users/BA018938/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:472:in `table_structure': Could not find table 'users' (ActiveRecord::StatementInvalid)
那么发生了什么?有人可以快速查看一下您是否可以从 GitHub 运行此示例?