代码之家  ›  专栏  ›  技术社区  ›  thedeepfield

last.fm如何在IRB中使用scrobbler gem?

  •  0
  • thedeepfield  · 技术社区  · 15 年前

    我正在测试IRB中的scrobbler/scrobbler2 gem(http://scrobbler.rubyforge.org/)。我的问题是每次我试着把它放进去 IRB ,我得到以下错误:

    ——

    Loading development environment (Rails 2.3.9)  
    >> album = Scrobbler::Album.new('Carrie Underwood', 'Some Hearts', :include_info => true)
    NameError: uninitialized constant Scrobbler from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:469:in 
    `load_missing_constant' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:106:in 
    `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:118:in `const_missing'
    

    ——

    我不明白这个错误,有人能给我指出正确的方向吗?

    非常感谢!!

    1 回复  |  直到 15 年前
        1
  •  0
  •   shingara    15 年前

    你需要吗?

    require 'scrobbler'