我在使用annotate gem时遇到了一些问题。我的ruby版本是2.3,rails版本是5beta3。bundle install看起来没什么问题,但当我尝试调用annotate命令时,出现了以下错误...
ruby@echobase:~/crash$ annotate
WARN: Unresolved specs during Gem::Specification.reset:
activerecord (< 6.0, >= 3.2)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/lib/ruby/gems/2.3.0/gems/annotate-2.7.0/lib/annotate.rb:12:in `require': cannot load such file -- active_support/core_ext/hash/indifferent_
access (LoadError)
from /usr/local/lib/ruby/gems/2.3.0/gems/annotate-2.7.0/lib/annotate.rb:12:in `rescue in <top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/annotate-2.7.0/lib/annotate.rb:6:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/annotate-2.7.0/bin/annotate:18:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/annotate-2.7.0/bin/annotate:18:in `<top (required)>'
from /usr/local/bin/annotate:22:in `load'
from /usr/local/bin/annotate:22:in `<main>'
不确定发生了什么。
annotate
命令失败时,可以尝试使用rake db:migrate
命令来解决问题。 对于Rails 5及更高版本,你可能需要从GitHub上使用devel分支: https://www.bountysource.com/issues/41011908-rake-12-0-0-support - sventechie