ActiveResource :: Collection正在给出NameError

时间:2016-04-18 15:23:04

标签: ruby ruby-on-rails-3 activeresource

enter image description here

我正在尝试在控制台上运行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正在运作。

2 个答案:

答案 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