3

更新:我的问题肯定与这个有关- 这是 ActiveRecord 的问题。还是没有解决。

我正在尝试通过 rspec 进行测试,但无法弄清楚出了什么问题......这就是我得到的:

Running: spec/models/user_spec.rb
.
.
.
........F

Failures:

  1) User when email address is already taken 
     Failure/Error: user_with_same_email.save
     ActiveRecord::StatementInvalid:
     SQLite3::SQLException: near "SAVEPOINT": 
     syntax error: SAVEPOINT active_record_1
     # ./spec/models/user_spec.rb:64:in `block (3 levels) in <top (required)>'

Finished in 0.22908 seconds
9 examples, 1 failure

这是我测试中的相关行:

user_with_same_email.save

尝试写入数据库时​​它会中断。发展很好 - 没有问题。谢谢

4

1 回答 1

2

问题是旧版本的 sqlite。我安装了 Homebrew 并运行brew install sqlite3 了由于文件已经存在而出现的一些错误。我只是将它们重命名*.old并运行brew link sqlite3。问题解决了!

于 2012-05-03T07:07:40.410 回答