我正在try 为Ruby on Rails运行rspec.我正在运行Rails 4.1.1.我已经安装了gem,建立了一个带有一些测试的spec文件夹.我已经创建了$ rails g rspec:install
个目录
我试图通过$ rake db:test:prepare
创建一个测试数据库,但它抛出以下错误消息:
WARNING: db:test:prepare is deprecated. The Rails test helper now maintains your test
schema automatically, see the release notes for details.
最后我看了this stack overflow post个选项,在这两个选项中,有效的一个是:
rake db:schema:load RAILS_ENV=test
所以,now I need to run rspec.
当我从命令行运行$ rspec spec
时,会出现以下错误:
/Users/myname/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/
kernel_require.rb:55:in `require': cannot load such file -- rails_helper (LoadError)
如何解决这个问题,以便开始运行测试?