Problem with Ruby + rtaglib gem

天涯浪子 提交于 2019-12-08 10:19:46

问题


I need to read ID3 tags from MP3 files, so i did some research and found that rtaglib is the way to go. The other plugins seems outdated, i tried them anyways but none of them work for me.

After installed the rtaglib gem (the ruby binding for TagLib http://developer.kde.org/~wheeler/taglib.html#bindings) i just can't make it work.

I tried adding both the gem to the gemfile and install it with sudo gem install rtaglib. I get the response like it's installed, but after that when i tried to require any of the two files i get:

?> require 'tagfile/tagfile' LoadError: no such file to load -- tagfile/tagfile from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'

Or if i tried TagLib:

require 'TagLib' => nil

I have tried to move the files manually from the zip file but that doesn't zip to work neither.

Thank you.


回答1:


If you are using Ubuntu you must install libtagc0-dev first, THEN install the gem.

At first I made the mistake of installing libtag1-dev, which gave me the same problem as you have.




回答2:


Make sure that you are including rubygems as well. If you are doing this from a Rake task or ruby script:

require 'rubygems'
require 'tagfile/tagfile'

I am doing this on OSX with the gem and taglib installed via homebrew and it works fine.



来源:https://stackoverflow.com/questions/4291544/problem-with-ruby-rtaglib-gem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!