Gems madness - require path hoopty?

There’s a nifty gem called MP4Info which enables you to get ID3-style
metadata from non-MP3 files, such as AAC files. It’s dag gol darn
usefulness and then some, but my attempts at requiring it were
troubled.

This works:

sudo gem install MP4Info

This works:

require ‘/opt/local/lib/ruby/gems/1.8/gems/MP4Info-0.3.1/lib/mp4info’

These don’t:

sudo gem install mp4info
require ‘mp4info’
require ‘MP4Info’
require ‘MP4Info-0.3.1’
require ‘MP4Info-0.3.1/lib/mp4info’

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On Dec 25, 2007, at 7:45 PM, ara.t.howard wrote:

On Dec 25, 2007, at 4:47 PM, Giles B. wrote:

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?

gemspec.rb

Did you also maybe forget to add

require ‘rubygems’

to the top?

On Dec 25, 2007, at 4:47 PM, Giles B. wrote:

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?

gemspec.rb

a @ http://codeforpeople.com/

On Dec 25, 8:47 pm, Giles B. [email protected] wrote:

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?

D:\Users\Luis>gem search --remote mp4info

*** REMOTE GEMS ***
Need to update 19 gems from http://gems.rubyforge.org

complete

MP4Info (0.3.1, 0.3, 0.2, 0.1)
MP4 tag reading library

D:\Users\Luis>gem search --remote MP4info

*** REMOTE GEMS ***

MP4Info (0.3.1, 0.3, 0.2, 0.1)
MP4 tag reading library

D:\Users\Luis>gem install mp4info --no-ri --no-rdoc
Successfully installed MP4Info-0.3.1

D:\Users\Luis>irb
irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘mp4info’
=> true
irb(main):003:0> M
MP4Info MatchData Math Module
Marshal MatchingData Method Mutex

HTH,

Luis

On Dec 25, 2007, at 15:47 PM, Giles B. wrote:

There’s a nifty gem called MP4Info which enables you to get ID3-style
metadata from non-MP3 files, such as AAC files. It’s dag gol darn
usefulness and then some, but my attempts at requiring it were
troubled.

[…]

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?

$ gem install MP4Info -i ~/tmp/gems
[…]
$ GEM_HOME=~/tmp/gems gem which mp4info
/Users/drbrain/tmp/gems/gems/MP4Info-0.3.1/lib/mp4info.rb
$ GEM_HOME=~/tmp/gems ruby -rubygems -e ‘require “mp4info”’
$

There’s nothing wrong with the gem.

a) You didn’t require ‘rubygems’ before require ‘mp4info’
b) gem env's ruby doesn’t match which ruby's ruby.

Besides a test script and a few bits of test data, .wav files etc.,
mp4info.rb is basically the only file in the gem. Is there anything
obvious I’m missing here?

gemspec.rb

Yep, that’s missing all right. I bet the gem would work better if it
had a gemspec file. I’m just guessing here, but I think you’re right.
:-p


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com