Search code examples
ruby-on-railstaglib-ruby

uninitialized constant ActivityObjects::BuildController::TagLib


I have tried to used taglib in rails. I put this code ( see below ) in the controller but got this error "uninitialized constant ActivityObjects::BuildController::TagLib"

    TagLib::FileRef.open(@activity_object.content_tone_url()) do |fileref|
      unless fileref.null?
        tag = fileref.tag
        title = tag.title
        artist = tag.artist
        album = tag.album
        genre = tag.genre
      end
    end 

Any idea how to used taglib in rails?


Solution

  • Ok guys I found the problem I forgot to put require 'taglib' for anybody who is newbie like me :)