升级到rails 5后无法使用rspec和rollbar。
- 创建 Rails 4 应用程序
- 升级 gemfile 以使用 Rails 5
- 尝试添加防滚杆 gem/support
标准配置/环境.rb:
# Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
运行 rspec 时出错:
An error occurred while loading {path to specific spec file}
Failure/Error: require File.expand_path('../../config/environment', __FILE__)
RuntimeError:
can't modify frozen Array
# ./config/environment.rb:6:in `<top (required)>'
# ./spec/rails_helper.rb:5:in `<top (required)>'
...
No examples found.
在大多数情况下,这个错误是为了转移其他事情的注意力。
遇到它时,不要被反复出现的情况所淹没can't modify frozen Array
错误消息,而是检查运行规范时出现的第一个错误。
例如:
失败/错误:验证:唯一性,如果:“should_be_unique?”
ArgumentError:传递要在 :if 和 :unless 中求值的字符串
不支持条件选项。为实例传递符号
方法,或者 lambda、proc 或 block。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)