如果要在没有数据库的情况下使用rails,database.yml 中应该包含哪些内容?
我正在使用没有数据库的rails3,并且想知道database.yml 中应该包含什么内容才能通过rake 测试。 现在失败了。我还没有在文件中指定任何内容。我的模型将使用 ActiveModel。
class User
# https://github.com/rails/rails/tree/master/activemodel
include ActiveModel::Validations
include ActiveModel::Conversion
...
end
运行耙子测试:
runtime/lib/ruby/gems/1.8/gems/memory_test_fix-0.1.3/lib/memory_test_fix.rb:29:in `in_memory_database?': undefined method `[]' for false:FalseClass (NoMethodError)
...
I am using rails3 without database and wondering what should be in database.yml to pass rake test.
It fails now. I didn't specify anything in the file yet. My models are going to use ActiveModel.
class User
# https://github.com/rails/rails/tree/master/activemodel
include ActiveModel::Validations
include ActiveModel::Conversion
...
end
Running rake test:
runtime/lib/ruby/gems/1.8/gems/memory_test_fix-0.1.3/lib/memory_test_fix.rb:29:in `in_memory_database?': undefined method `[]' for false:FalseClass (NoMethodError)
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下内容必须位于 application.rb 中:
而不是
the following must be in application.rb:
Instead of
从您的环境中删除活动记录.rb
remove active record from your environment.rb