Ok guys I found the problem I forgot to put require 'taglib' for anybody who is newbie like me :)
uninitialized constant ActivityObjects::BuildController::TagLib
-
30-05-2022 - |
Вопрос
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?
Решение
Другие советы
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 ...
Не связан с StackOverflow