Reputation: 771
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?
Upvotes: 0
Views: 185
Reputation: 771
Ok guys I found the problem I forgot to put require 'taglib' for anybody who is newbie like me :)
Upvotes: 1
Reputation: 11904
Ruby is looking in your current module namespace for the TagLib
constant. To ensure it looks at the top level instead, precede with "::", i.e. ::TagLib::FileRef.open ...
Upvotes: 0