我正在尝试在控制台上运行ActiveResource :: Collection,但它给出了名称错误。请给我一个解决方案来解决这个问题。
NameError: uninitialized constant ActiveResource::Collection
from (irb):10
from /var/lib/gems/2.1.0/gems/railties-3.2.17/lib/rails/commands/console.rb:47:in `start'
from /var/lib/gems/2.1.0/gems/railties-3.2.17/lib/rails/commands/console.rb:8:in `start'
from /var/lib/gems/2.1.0/gems/railties-3.2.17/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
更新
其他像ActiveResource :: Base,ActiveResource :: Format,ActiveResource :: Connection正在运作。
答案 0 :(得分:0)
看起来你没有添加ActiveResource
。将其添加到Gemfile
并运行bundle install
。
# Gemfile
gem 'activeresource'
# Command line
bundle install
答案 1 :(得分:0)
我通过将activeresource gem版本更新为 activeresource-4.0.0 来解决了这个问题。之前它是 activeresource-3.2.17 。